def login_required(func):
    '\n    验证是否登录\n    :param func:\n    :return:\n    '

    @wraps(func)
    def wrapper(*args, **kwargs):
        user_account = session.get('username', '')
        if user_account:
            login_user = SfoServerUser.query_user_by_account(user_account)
            g.user = login_user
            return func(*args, **kwargs)
        else:
            return ResponseBase(json.dumps({'status': 401, 'message': u'请先登录'}), status=401, content_type='application/json')
    return wrapper
验证是否登录
:param func:
:return:
def login_required(func):
    '\n    验证是否登录\n    :param func:\n    :return:\n    '

    @wraps(func)
    def wrapper(*args, **kwargs):
        user_account = session.get('username', )
        if user_account:
            login_user = SfoServerUser.query_user_by_account(user_account)
            g.user = login_user
            return func(*args, **kwargs)
        else:
            return ResponseBase(json.dumps({'status': 401, 'message': u'请先登录'}), status=401, content_type='application/json')
    return wrapper