Example #1
0
def create_code():
    '''创建代码'''
    if not g.current_user:
        return BaseResponse.return_unauthorized('请先登录')
    args = request.json
    item = Code.create_or_update(**args)
    return BaseResponse.return_success(item.format())
Example #2
0
 def decorated_function(*args, **kwargs):
     if g.user is None:
         return BaseResponse.return_unauthorized()
     return f(*args, **kwargs)