From d144f1be67a430dd4850bc0e93ea0124c6212e97 Mon Sep 17 00:00:00 2001 From: chenzhipei <18605199364@163.com> Date: Wed, 8 Dec 2021 19:15:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=8E=A8=E9=80=81=E5=86=85=E5=AE=B9=E5=8C=85=E5=90=AB?= =?UTF-8?q?'/'=E4=BC=9A=E5=87=BA=E7=8E=B0=E4=B9=B1=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/steedos-plugin-qywx/src/qywx/api.js | 1 + packages/steedos-plugin-qywx/src/qywx/notifications.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/steedos-plugin-qywx/src/qywx/api.js b/packages/steedos-plugin-qywx/src/qywx/api.js index 070348599e..562d858d80 100644 --- a/packages/steedos-plugin-qywx/src/qywx/api.js +++ b/packages/steedos-plugin-qywx/src/qywx/api.js @@ -167,6 +167,7 @@ router.get("/api/qiyeweixin/auth_login", async function (req, res, next) { // res.write('

请联系管理员配置企业微信工作区ID和用户ID...

'); return res.end(''); } + // console.log("user: ",user); if (userId && authToken) { if (user.user != userId) { // console.log("userId: ",userId); diff --git a/packages/steedos-plugin-qywx/src/qywx/notifications.js b/packages/steedos-plugin-qywx/src/qywx/notifications.js index 07b986b8b5..e539e2e8b3 100644 --- a/packages/steedos-plugin-qywx/src/qywx/notifications.js +++ b/packages/steedos-plugin-qywx/src/qywx/notifications.js @@ -60,14 +60,16 @@ module.exports = { if (payload.related_to) { text = options.text; } - + // 替换/为'/' + let rg = new RegExp("/","g") + let msg = { "touser": qywx_userId, "msgtype": "textcard", "agentid": agentId, "textcard": { - "title": title, - "description": text, + "title": title.replace(rg,'/'), + "description": text.replace(rg,'/'), "url": url, "btntxt": "详情" },