处理企业微信推送内容包含'/'会出现乱码的问题

This commit is contained in:
chenzhipei 2021-12-08 19:15:21 +08:00
parent 7fa22687af
commit d144f1be67
2 changed files with 6 additions and 3 deletions

View File

@ -167,6 +167,7 @@ router.get("/api/qiyeweixin/auth_login", async function (req, res, next) {
// res.write('<h2>请联系管理员配置企业微信工作区ID和用户ID...</h2>');
return res.end('');
}
// console.log("user: ",user);
if (userId && authToken) {
if (user.user != userId) {
// console.log("userId: ",userId);

View File

@ -60,14 +60,16 @@ module.exports = {
if (payload.related_to) {
text = options.text;
}
// 替换&#x2F为'/'
let rg = new RegExp("&#x2F;","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": "详情"
},