From 719fef68b9882a0988428ff45e23f60557f7fc48 Mon Sep 17 00:00:00 2001 From: Easy Date: Tue, 1 Oct 2024 14:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8DServer=E9=85=B1APP=E5=88=86?= =?UTF-8?q?=E6=94=AF=EF=BC=88Server=E9=85=B1=C2=B3=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=B7=B2=E5=BA=9F=E5=BC=83=E7=9A=84=E6=97=A7?= =?UTF-8?q?=E7=89=88api=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/notify.ts | 6 +++--- sample/notify.js | 6 +++--- sample/notify.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/back/services/notify.ts b/back/services/notify.ts index fcdd3c12..b018c0b5 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -151,9 +151,9 @@ export default class NotificationService { private async serverChan() { const { serverChanKey } = this.params; - const url = serverChanKey.startsWith('SCT') - ? `https://sctapi.ftqq.com/${serverChanKey}.send` - : `https://sc.ftqq.com/${serverChanKey}.send`; + const url = serverChanKey.startsWith('sctp') + ? `https://${serverChanKey}.push.ft07.com/send` + : `https://sctapi.ftqq.com/${serverChanKey}.send`; try { const res: any = await got .post(url, { diff --git a/sample/notify.js b/sample/notify.js index b879162a..f5c77cd1 100644 --- a/sample/notify.js +++ b/sample/notify.js @@ -225,9 +225,9 @@ function serverNotify(text, desp) { // 微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 desp = desp.replace(/[\n\r]/g, '\n\n'); const options = { - url: PUSH_KEY.includes('SCT') - ? `https://sctapi.ftqq.com/${PUSH_KEY}.send` - : `https://sc.ftqq.com/${PUSH_KEY}.send`, + url: PUSH_KEY.startsWith('sctp') + ? `https://${PUSH_KEY}.push.ft07.com/send` + : `https://sctapi.ftqq.com/${PUSH_KEY}.send`, body: `text=${text}&desp=${desp}`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', diff --git a/sample/notify.py b/sample/notify.py index 3d88f597..4f4ceb3c 100644 --- a/sample/notify.py +++ b/sample/notify.py @@ -298,10 +298,10 @@ def serverJ(title: str, content: str) -> None: print("serverJ 服务启动") data = {"text": title, "desp": content.replace("\n", "\n\n")} - if push_config.get("PUSH_KEY").find("SCT") != -1: - url = f'https://sctapi.ftqq.com/{push_config.get("PUSH_KEY")}.send' + if push_config.get("PUSH_KEY").startswith("sctp"): + url = f'https://{push_config.get("PUSH_KEY")}.push.ft07.com/send' else: - url = f'https://sc.ftqq.com/{push_config.get("PUSH_KEY")}.send' + url = f'https://sctapi.ftqq.com/{push_config.get("PUSH_KEY")}.send' response = requests.post(url, data=data).json() if response.get("errno") == 0 or response.get("code") == 0: