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
|
return result
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}).catch((error)=>{
|
||||||
|
return { _state: 'SMS_SEND_FAIL', error }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -108,16 +110,16 @@ module.exports = {
|
|||||||
TemplateParam: JSON.stringify(msgParam), //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时。
|
TemplateParam: JSON.stringify(msgParam), //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时。
|
||||||
})
|
})
|
||||||
.then(
|
.then(
|
||||||
function (res) {
|
function (result) {
|
||||||
let { Code } = res
|
let { Code } = result
|
||||||
if (Code === 'OK') {
|
if (Code === 'OK') {
|
||||||
return { _state: 'SMS_SENT_SUCCESS' }
|
return { _state: 'SMS_SENT_SUCCESS' }
|
||||||
} else {
|
} else {
|
||||||
return { _state: 'SMS_SEND_FAIL', result: res }
|
return { _state: 'SMS_SEND_FAIL', result }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (err) {
|
function (error) {
|
||||||
return { _state: 'SMS_SEND_ERROR', error: err }
|
return { _state: 'SMS_SEND_ERROR', error }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user