短信error
This commit is contained in:
@@ -41,7 +41,10 @@ module.exports = {
|
|||||||
return async function (phone, option = {}) { // 通过option对象,对外提供统一的调用参数格式
|
return async function (phone, option = {}) { // 通过option对象,对外提供统一的调用参数格式
|
||||||
if (/^\+\d+-\d+$/.test(phone)) {
|
if (/^\+\d+-\d+$/.test(phone)) {
|
||||||
if (option.msgParam && option.templateCode && option.signName) {
|
if (option.msgParam && option.templateCode && option.signName) {
|
||||||
return await sendSmsAliyun(smsClient, phone, option.msgParam, option.templateCode, option.signName);
|
return await sendSmsAliyun(smsClient, phone, option.msgParam, option.templateCode, option.signName).catch(err => {
|
||||||
|
const errmsg = '短信发送失败 ' + JSON.stringify(err);
|
||||||
|
mylog && mylog.error ? mylog.error(errmsg) : console.error(errmsg);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null; // 手机号格式错误,或者 option.vendor 错误。
|
return null; // 手机号格式错误,或者 option.vendor 错误。
|
||||||
|
|||||||
Reference in New Issue
Block a user