修改配置和response的细节

This commit is contained in:
2025-12-30 16:57:31 +08:00
parent 8972246445
commit d191b13455
5 changed files with 308 additions and 205 deletions

View File

@@ -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}