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