#!/usr/bin/python
# coding: utf-8

import jwt
import time
secret = "adminhpc"


def create_token(play_load):
    play_load['iss'] = "sys"
    play_load['exp'] = (time.time()+1800)
    play_load['iat'] = time.time()
    # byte2string解码成str
    token = bytes.decode(jwt.encode(play_load, secret))
    return token


# 校验token
def valid_token(valid):
    try:
        return jwt.decode(valid, secret)
    except Exception:
        return False


1763763807f1c1cd7be61c4ed1a9363edd9b22ac
<mask token>

<mask token>


def create_token(play_load):
    play_load['iss'] = 'sys'
    play_load['exp'] = time.time() + 1800
    play_load['iat'] = time.time()
    token = bytes.decode(jwt.encode(play_load, secret))
    return token


def valid_token(valid):
    try:
        return jwt.decode(valid, secret)
    except Exception:
        return False

<mask token>
secret = 'adminhpc'


def create_token(play_load):
    play_load['iss'] = 'sys'
    play_load['exp'] = time.time() + 1800
    play_load['iat'] = time.time()
    token = bytes.decode(jwt.encode(play_load, secret))
    return token


def valid_token(valid):
    try:
        return jwt.decode(valid, secret)
    except Exception:
        return False

import jwt
import time
secret = 'adminhpc'


def create_token(play_load):
    play_load['iss'] = 'sys'
    play_load['exp'] = time.time() + 1800
    play_load['iat'] = time.time()
    token = bytes.decode(jwt.encode(play_load, secret))
    return token


def valid_token(valid):
    try:
        return jwt.decode(valid, secret)
    except Exception:
        return False

#!/usr/bin/python
# coding: utf-8

import jwt
import time
secret = "adminhpc"


def create_token(play_load):
    play_load['iss'] = "sys"
    play_load['exp'] = (time.time()+1800)
    play_load['iat'] = time.time()
    # byte2string解码成str
    token = bytes.decode(jwt.encode(play_load, secret))
    return token


# 校验token
def valid_token(valid):
    try:
        return jwt.decode(valid, secret)
    except Exception:
        return False

