From b2884ce0a0440528e52e3eb525ef23e4bf5705ca Mon Sep 17 00:00:00 2001 From: Lei OT Date: Sat, 12 Oct 2024 16:22:20 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BD=8D=E7=BD=AE=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/channel/whatsappUtils.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/channel/whatsappUtils.js b/src/channel/whatsappUtils.js index b2d26b1..f347aaf 100644 --- a/src/channel/whatsappUtils.js +++ b/src/channel/whatsappUtils.js @@ -468,7 +468,9 @@ export const whatsappMsgTypeMapped = { id: msg.wamid, title: `位置信息 ${msg.location.name || ''} ↓打开高德地图`, text: msg.location.address, // 地址 - src: `https://uri.amap.com/marker?position=${msg.location.longitude},${msg.location.latitude}&callnative=1`, + // src: `https://uri.amap.com/marker?position=${msg.location.longitude},${msg.location.latitude}&callnative=1`, + src: 'https://cdn.pixabay.com/photo/2016/03/22/04/23/map-1272165_1280.png', + href: `https://uri.amap.com/marker?position=${msg.location.longitude},${msg.location.latitude}&callnative=1`, data: { longitude: msg.location?.longitude, latitude: msg.location?.latitude, @@ -543,6 +545,11 @@ export const parseRenderMessageList = (messages) => { if (typeof msg.msgtext_AsJOSN === 'string') { // debug: json 缺少一部分 msgContentString = msg.msgtext_AsJOSN.charAt(msg.msgtext_AsJOSN.length - 1) !== '}' ? msg.msgtext_AsJOSN + '}}' : msg.msgtext_AsJOSN; + // if (msg.msgtext_AsJOSN.charAt(msg.msgtext_AsJOSN.length - 1) === '"') { + // msgContentString = msg.msgtext_AsJOSN + '}}'; + // } else { + // msgContentString = msg.msgtext_AsJOSN + '"}'; + // } } const msgContent = typeof msg.msgtext_AsJOSN === 'string' ? JSON.parse(msgContentString) : msg.msgtext_AsJOSN; msgContent.template = msg.msgtype === 'template' ? { ...msgContent.template, ...msg.template_AsJOSN } : {};