发送失败: 同步返回的错误码显示; +后续操作提示

dev/code-splitting
Lei OT 2 years ago
parent 2bb6794d22
commit 22f1a2c0bf

@ -290,7 +290,16 @@ export const receivedMsgTypeMapped = {
// 发送消息的同步返回: 发送失败时
getMsg: (result) => result,
contentToRender: () => null,
contentToUpdate: (msgcontent) => ({ ...msgcontent, id: msgcontent.actionId, status: msgcontent?.status || 'failed', dateString: `发送失败 ${msgcontent.error.message}`, conversationid: msgcontent.actionId.split('.')[0], }),
contentToUpdate: (msgcontent) => {
const waCode = msgcontent.error.message.match(/\(#(\d+)\)/);
const waError = whatsappError?.[waCode?.[1]] || msgcontent.error.message;
return {
...msgcontent,
id: msgcontent.actionId,
status: msgcontent?.status || 'failed',
dateString: `发送失败 ${waError} \n[${msgcontent.error.code}] ${whatsappError[msgcontent.error.code]}`,
conversationid: msgcontent.actionId.split('.')[0],
};},
},
};
export const whatsappMsgTypeMapped = {
@ -568,8 +577,9 @@ export const parseRenderMessageList = (messages) => {
});
};
export const whatsappError = {
'131026': '[131026] 消息无法投递(未注册/使用旧版/未同意政策).',
'131047': '[131047] 会话超过24小时.',
'BAD_REQUEST': '无法发送, 请使用邮件联系.',
'131026': '[131026] 消息无法投递(未注册/使用旧版/未同意政策).\n请稍后重试或使用邮件联系',
'131047': '[131047] 会话超过24小时或未激活. \n请使用模板消息发送',
'131053': '[131053] 文件上传失败.',
'131048': '[131048] 账户被风控.', // 消息发送太多, 达到垃圾数量限制
'131031': '[131031] 账户已锁定.',

Loading…
Cancel
Save