You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
522 B
19 lines
522 B
2 years ago
|
#!/usr/bin/env python
|
||
|
# -*- encoding: utf-8 -*-
|
||
|
'''
|
||
|
@Date:2022/07/27 16:11:57
|
||
|
'''
|
||
|
from flask import jsonify
|
||
|
from werkzeug.http import HTTP_STATUS_CODES
|
||
|
|
||
|
from common.utils import Utils
|
||
|
|
||
|
def error_response(status_code, message=None):
|
||
|
payload = Utils.except_return(
|
||
|
msg="请登录", status=status_code)
|
||
|
# payload = {'error': HTTP_STATUS_CODES.get(status_code, 'Unknown error')}
|
||
|
if message:
|
||
|
payload['msg'] = message
|
||
|
response = jsonify(payload)
|
||
|
response.status_code = 200
|
||
|
return response
|