修复 pushplus 推送内容显示异常问题

This commit is contained in:
beanjs 2024-09-28 17:08:56 +08:00
parent 625f1cd152
commit 50af605dad

View File

@ -761,7 +761,9 @@ function pushPlusNotify(text, desp, params) {
return new Promise((resolve) => {
const { PUSH_PLUS_TOKEN, PUSH_PLUS_USER } = push_config;
if (PUSH_PLUS_TOKEN) {
desp = desp.replace(/[\n\r]/g, '<br>'); // 默认为html, 不支持plaintext
if(!params.template || params.template == 'html'){
desp = desp.replace(/[\n\r]/g, '<br>'); // 默认为html, 不支持plaintext
}
const body = {
token: `${PUSH_PLUS_TOKEN}`,
title: `${text}`,