fix: send_sms因httperror不处理

This commit is contained in:
caoqianming 2023-12-21 11:13:48 +08:00
parent 0b20386fcc
commit 6bfd5ea9c4
1 changed files with 33 additions and 30 deletions

View File

@ -13,6 +13,7 @@ def send_sms(phone: str, template_code: int, template_param: dict):
config = get_sysconfig()
if config['sms'].get('enabled', True) is False:
return
try:
client = AcsClient(config['sms']['xn_key'], config['sms']['xn_secret'], 'default')
request = CommonRequest()
# 固定json
@ -44,6 +45,8 @@ def send_sms(phone: str, template_code: int, template_param: dict):
else:
myLogger.error("短信发送失败:{}-{}-{}-{}".format(phone, template_code, str(template_param), str(res_dict)))
return False, res_dict
except Exception:
myLogger.error("短信发送失败", exc_info=True)
def send_sms_huawei():