perf: WA发送失败: 提示

dev/timezone
Lei OT 2 years ago
parent c168eb9b8a
commit dbe9441a46

@ -291,13 +291,21 @@ export const receivedMsgTypeMapped = {
getMsg: (result) => result,
contentToRender: () => null,
contentToUpdate: (msgcontent) => {
let apiErrorCode, apiErrorMsg = '';
const waCode = msgcontent.error.message.match(/\(#(\d+)\)/);
const waError = whatsappError?.[waCode?.[1]] || msgcontent.error.message;
let waError = whatsappError?.[waCode?.[1]] || msgcontent.error.message;
apiErrorMsg = whatsappError[msgcontent.error.code];
if (msgcontent.error.message.includes('Invalid E.146 phone number')) {
waError = whatsappError.INVALID_PHONE_NUMBER;
apiErrorMsg = '';
}
return {
...msgcontent,
id: msgcontent.actionId,
status: msgcontent?.status || 'failed',
dateString: `发送失败 ${waError} \n[${msgcontent.error.code}] ${whatsappError[msgcontent.error.code]}`,
dateString: `发送失败 ${waError} \n[${msgcontent.error.code}] ${apiErrorMsg}`,
conversationid: msgcontent.actionId.split('.')[0],
};},
},
@ -540,7 +548,7 @@ export const parseRenderMessageList = (messages) => {
(waError = (whatsappError?.[waCode?.[1]] || whatsappError?.[msgContent.errorCode] || msgContent.errorMessage));
if (!isEmpty(msgContent.whatsappApiError)) {
waError = whatsappError?.[msgContent.whatsappApiError.code] || msgContent.whatsappApiError.message;
waError += `\n[${msgContent.errorCode}] ${whatsappError?.[msgContent.errorCode] || msgContent.errorMessage}`;
// waError += `\n[${msgContent.errorCode}] ${whatsappError?.[msgContent.errorCode] || msgContent.errorMessage}`;
}
if (msgContent.errorMessage.includes('Invalid E.146 phone number')) {
waError = whatsappError.INVALID_PHONE_NUMBER;
@ -597,8 +605,8 @@ export const whatsappError = {
'PARAM_INVALID': '参数错误, 请联系技术组',
'INVALID_PHONE_NUMBER': '无效号码, 请修正号码后尝试发送',
'100': '参数错误, 请联系技术组',
'131026': '[131026] 消息无法投递(未注册/使用旧版/未同意政策).\n请稍后重试或使用邮件联系',
'131047': '[131047] 会话超过24小时或未激活. \n请使用模板消息发送',
'131026': '[131026] 消息无法投递(未注册).\n请使用邮件联系',
'131047': '[131047] 会话未激活. \n请使用模板消息发送',
'131053': '[131053] 文件上传失败.',
'131048': '[131048] 账户被风控.', // 消息发送太多, 达到垃圾数量限制
'131031': '[131031] 账户已锁定.',

Loading…
Cancel
Save