This commit is contained in:
eric
2023-05-04 17:33:38 +08:00
parent ed5485252c
commit aded3565e3

12
app.py
View File

@@ -108,8 +108,8 @@ async def getphonenum(
uid: Union[str, None] = Header(default=None)
):
err_code=0
outputArguments=''
err_code=-1
outputArguments='验证码发送失败,请检查手机号格式,或其他异常'
print("inputArguments", inputArguments)
# uid:唯一标识用户的openid
# print("appid", appid, "bid", bid, "requestid", requestid, "uid", uid)
@@ -129,6 +129,7 @@ async def getphonenum(
# 判断用户uid是都触发过短信,不允许触发第2次
if findUid(uid, phonenumber) is True:
err_code=-1
outputArguments='验证已发送,不允许重复触发'
print("用户uid已存在,不触发短信")
# sendTg(f"用户{uid}已存在,不触发短信")
else:
@@ -148,10 +149,9 @@ async def getphonenum(
if err_code==0:
outputArguments='验证码发送成功'
else:
outputArguments='验证码发送失败,请检查手机号格式,或其他异常'
# 成功的响应 1成功 2失败
pass
# 成功的响应 0成功 -1失败
content = {"err_code": err_code,"data_list": [{"outputArguments":outputArguments}]}
headers = {"Content-Type": "application/json"}
return JSONResponse(content=content, headers=headers)