修改配置和response的细节
This commit is contained in:
@@ -29,5 +29,11 @@ def normalize_url(url: str) -> str:
|
||||
if not path: path = ""
|
||||
return urlunparse((scheme, netloc, path, parsed.params, parsed.query, ""))
|
||||
|
||||
def make_response(code: int, msg: str, data: any = None):
|
||||
def make_response(code: int, msg: str = "Success", data: any = None):
|
||||
"""
|
||||
统一响应格式
|
||||
:param code: 1 成功, 0 失败, 其他自定义
|
||||
:param msg: 提示信息
|
||||
:param data: 返回数据
|
||||
"""
|
||||
return {"code": code, "msg": msg, "data": data}
|
||||
Reference in New Issue
Block a user