From 97d170c8b102801050964835614961a5daa8e52c Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 26 Mar 2022 17:17:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9FpushDeer?= =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/notify.ts | 7 +++---- src/utils/config.ts | 10 ++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/back/services/notify.ts b/back/services/notify.ts index 5dd053f6..282a69dd 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -119,15 +119,14 @@ export default class NotificationService { private async pushDeer() { const { pushDeerKey } = this.params; - // https://api2.pushdeer.com/message/push?pushkey=&text=标题&desp=&type=markdown const url = `https://api2.pushdeer.com/message/push`; const res: any = await got .post(url, { timeout: this.timeout, retry: 0, - body: `pushkey=${pushDeerKey}&text=${ - this.title - }&desp=${encodeURIComponent(this.content)}&type=markdown`, + body: `pushkey=${pushDeerKey}&text=${encodeURIComponent( + this.title, + )}&desp=${encodeURIComponent(this.content)}&type=markdown`, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, }) .json(); diff --git a/src/utils/config.ts b/src/utils/config.ts index bdcde9d9..9d9b323e 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -77,7 +77,7 @@ export default { { value: 'gotify', label: 'Gotify' }, { value: 'goCqHttpBot', label: 'GoCqHttpBot' }, { value: 'serverChan', label: 'Server酱' }, - { value: 'PushDeer', label: 'PushDeer' }, + { value: 'pushDeer', label: 'PushDeer' }, { value: 'bark', label: 'Bark' }, { value: 'telegramBot', label: 'Telegram机器人' }, { value: 'dingtalkBot', label: '钉钉机器人' }, @@ -114,7 +114,13 @@ export default { serverChan: [ { label: 'serverChanKey', tip: 'Server酱SENDKEY', required: true }, ], - PushDeer: [{ label: 'PushDeerKey', tip: 'PushDeer的Key', required: true }], + pushDeer: [ + { + label: 'pushDeerKey', + tip: 'PushDeer的Key,https://github.com/easychen/pushdeer', + required: true, + }, + ], bark: [ { label: 'barkPush',