feat: update api
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
14a27437a1
commit
5a83cea081
|
@ -28,9 +28,11 @@ def login_required(f):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
token = request.headers.get("Authorization", default=None)
|
token = request.headers.get("Authorization", default=None)
|
||||||
if not token:
|
if not token:
|
||||||
|
# TODO raise apiflask 的 json 格式的 error
|
||||||
return '请登陆'
|
return '请登陆'
|
||||||
user_id = rpc.admin.identify(token)
|
user_id = rpc.admin.identify(token)
|
||||||
if not user_id:
|
if not user_id:
|
||||||
|
# TODO raise apiflask 的 json 格式的 error
|
||||||
return '请登陆'
|
return '请登陆'
|
||||||
session['user_id'] = user_id
|
session['user_id'] = user_id
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue