From 3917c818736bc53354408a47858defda2f664713 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Fri, 19 Feb 2021 09:53:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=80=9A=E7=9F=A5=E5=85=BC?= =?UTF-8?q?=E5=AE=B9Server=E9=85=B1=C2=B7Turbo=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sendNotify.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sendNotify.js b/sendNotify.js index ba6daa79..5b7f4f33 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -158,15 +158,8 @@ function serverNotify(text, desp, timeout = 2100) { if (SCKEY) { //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 desp = desp.replace(/[\n\r]/g, '\n\n'); - let serverurl=""; - let SCedition = SCKEY.indexOf("SCU"); - if(SCedition == 0){ - serverurl=`https://sc.ftqq.com/${SCKEY}.send` - }else if(SCedition == -1){ - serverurl=`https://sctapi.ftqq.com/${SCKEY}.send` - } const options = { - url: serverurl, + url: SCKEY.includes('SCT') ? `https://sctapi.ftqq.com/${SCKEY}.send` : `https://sc.ftqq.com/${SCKEY}.send`, body: `text=${text}&desp=${desp}`, headers: { 'Content-Type': 'application/x-www-form-urlencoded'