kboss/b/jdcloud/send_verify_code.dspy
2025-07-16 14:27:17 +08:00

27 lines
957 B
Plaintext

async def send_verify_code(ns={}):
sendVerificationCodeInfo = {
'mobilePhone': ns.get('mobile')
}
try:
parameters = JDAPI.SendVerificationCodeRequest.SendVerificationCodeParameters(partnerId="44733868076", sendVerificationCodeInfo=sendVerificationCodeInfo)
request = JDAPI.SendVerificationCodeRequest.SendVerificationCodeRequest(parameters)
resp = JDAPI.CpClient.send(request)
print(resp.result)
if (not resp.error) and (not resp.result):
return {
'status': True,
'msg': 'sms verify code send success'
}
else:
return {
'status': False,
'msg': 'sms code send failed, %s' % resp.error.message
}
except Exception as e:
return {
'status': False,
'msg': 'sms code failed, %s' % str(e)
}
ret = await send_verify_code(params_kw)
return ret