This commit is contained in:
yumoqing 2026-05-31 12:38:10 +08:00
parent 2b639c7eaf
commit 0db205d0ef

View File

@ -100,9 +100,9 @@ class SMSEngine:
async def send(self, stype, template_id, phone, params) -> dict: async def send(self, stype, template_id, phone, params) -> dict:
try: try:
f = partial(self.sms_client.send_message, signature_id=self.signature_id, f = partial(self.sms_client.send_message, signature_id=self.signature_id,
template_id=template_id, template_id=template_id,
mobile=phone, mobile=phone,
content_var_dict=params) content_var_dict=params)
resp = await awaitify(f)() resp = await awaitify(f)()
return await self.__validation(stype, template_id, params, phone, resp) return await self.__validation(stype, template_id, params, phone, resp)
except ex.BceHttpClientError as e: except ex.BceHttpClientError as e:
@ -173,14 +173,14 @@ class SMSEngine:
'del_flg': '0', 'del_flg': '0',
'create_at': datetime.datetime.now() 'create_at': datetime.datetime.now()
}) })
vcode = {'SMSvCode': code} vcode = {'SMSvCode': code}
# d = await self.send_vcode(phone, "用户注册登录验证", vcode) # d = await self.send_vcode(phone, "用户注册登录验证", vcode)
d = await self.send_vcode(phone, "用户注册登录验证", vcode) d = await self.send_vcode(phone, "用户注册登录验证", vcode)
debug(f'{d=}, {code=}, {phone=}') debug(f'{d=}, {code=}, {phone=}')
if d['status']: if d['status']:
return code_id, code return code_id, code
else: else:
return None return None
async def check_sms_code(self, code_id: str, vcode: str) -> bool: async def check_sms_code(self, code_id: str, vcode: str) -> bool:
env = ServerEnv() env = ServerEnv()