feat: add api of body record
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -5,6 +5,8 @@ from functools import wraps
|
||||
|
||||
from flask import request, session
|
||||
|
||||
from app.api.v1.exception.auth import AuthError
|
||||
|
||||
|
||||
def split_group(dict_list, key):
|
||||
dict_list.sort(key=itemgetter(key))
|
||||
@@ -28,12 +30,10 @@ def login_required(f):
|
||||
def wrapper(*args, **kwargs):
|
||||
token = request.headers.get("Authorization", default=None)
|
||||
if not token:
|
||||
# TODO raise apiflask 的 json 格式的 error
|
||||
return '请登陆'
|
||||
raise AuthError()
|
||||
user_id = rpc.admin.identify(token)
|
||||
if not user_id:
|
||||
# TODO raise apiflask 的 json 格式的 error
|
||||
return '请登陆'
|
||||
raise AuthError()
|
||||
session['user_id'] = user_id
|
||||
return f(*args, **kwargs)
|
||||
return wrapper
|
||||
|
Reference in New Issue
Block a user