catch error for dxton
This commit is contained in:
parent
2be5befb79
commit
68e4041388
12
messenger.js
12
messenger.js
@ -80,6 +80,8 @@ module.exports = {
|
||||
return result
|
||||
}
|
||||
})
|
||||
}).catch((error)=>{
|
||||
return { _state: 'SMS_SEND_FAIL', error }
|
||||
})
|
||||
},
|
||||
|
||||
@ -108,16 +110,16 @@ module.exports = {
|
||||
TemplateParam: JSON.stringify(msgParam), //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时。
|
||||
})
|
||||
.then(
|
||||
function (res) {
|
||||
let { Code } = res
|
||||
function (result) {
|
||||
let { Code } = result
|
||||
if (Code === 'OK') {
|
||||
return { _state: 'SMS_SENT_SUCCESS' }
|
||||
} else {
|
||||
return { _state: 'SMS_SEND_FAIL', result: res }
|
||||
return { _state: 'SMS_SEND_FAIL', result }
|
||||
}
|
||||
},
|
||||
function (err) {
|
||||
return { _state: 'SMS_SEND_ERROR', error: err }
|
||||
function (error) {
|
||||
return { _state: 'SMS_SEND_ERROR', error }
|
||||
}
|
||||
)
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user