Commit f7dc08af authored by wanli's avatar wanli

🐞 fix(): 修改两处配置

parent 8e48dbda
......@@ -40,7 +40,7 @@ def run():
# app.logger.setLevel(app.config.get('LOG_LEVEL', logging.INFO))
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(int(port), address=host, xheaders=True)
http_server.listen(int(port), address=host)
IOLoop.instance().start()
@manager.command
......
......@@ -59,16 +59,17 @@ def _custom_abort(http_status_code, **kwargs):
"""
自定义abort 400响应数据格式
"""
if http_status_code == 400:
message = kwargs.get('msg')
if isinstance(message, dict):
param, info = list(message.items())[0]
data = '{}:{}!'.format(param, info)
return abort(jsonify(response_result(ResponseCode.HTTP_INVAILD_REQUEST, data=data)))
else:
return abort(jsonify(response_result(ResponseCode.HTTP_INVAILD_REQUEST, data=message)))
# return { 'code': http_status_code, 'msg': kwargs.get('message') }
return abort(http_status_code)
logger.info(kwargs)
# if http_status_code == 400:
# message = kwargs.get('msg')
# if isinstance(message, dict):
# param, info = list(message.items())[0]
# data = '{}:{}!'.format(param, info)
# return abort(jsonify(response_result(ResponseCode.HTTP_INVAILD_REQUEST, data=data)))
# else:
# return abort(jsonify(response_result(ResponseCode.HTTP_INVAILD_REQUEST, data=message)))
return abort(jsonify({ 'code': http_status_code, 'msg': kwargs }))
# return abort(http_status_code)
def _access_control(response):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment