mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-28 07:06:06 +08:00
变量重命名
This commit is contained in:
parent
53bdc7fd5d
commit
58ffcde9f9
|
@ -2,7 +2,7 @@ export enum NotificationMode {
|
|||
'gotify' = 'gotify',
|
||||
'goCqHttpBot' = 'goCqHttpBot',
|
||||
'serverChan' = 'serverChan',
|
||||
'PushDeer' = 'PushDeer',
|
||||
'pushDeer' = 'pushDeer',
|
||||
'bark' = 'bark',
|
||||
'telegramBot' = 'telegramBot',
|
||||
'dingtalkBot' = 'dingtalkBot',
|
||||
|
@ -34,7 +34,7 @@ export class ServerChanNotification extends NotificationBaseInfo {
|
|||
}
|
||||
|
||||
export class PushDeerNotification extends NotificationBaseInfo {
|
||||
public PushDeerKey = '';
|
||||
public pushDeerKey = '';
|
||||
}
|
||||
|
||||
export class BarkNotification extends NotificationBaseInfo {
|
||||
|
|
|
@ -16,7 +16,7 @@ export default class NotificationService {
|
|||
['gotify', this.gotify],
|
||||
['goCqHttpBot', this.goCqHttpBot],
|
||||
['serverChan', this.serverChan],
|
||||
['PushDeer', this.PushDeer],
|
||||
['pushDeer', this.pushDeer],
|
||||
['bark', this.bark],
|
||||
['telegramBot', this.telegramBot],
|
||||
['dingtalkBot', this.dingtalkBot],
|
||||
|
@ -117,15 +117,17 @@ export default class NotificationService {
|
|||
return res.errno === 0 || res.data.errno === 0;
|
||||
}
|
||||
|
||||
private async PushDeer() {
|
||||
const { PushDeerKey } = this.params;
|
||||
private async pushDeer() {
|
||||
const { pushDeerKey } = this.params;
|
||||
// https://api2.pushdeer.com/message/push?pushkey=<key>&text=标题&desp=<markdown>&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=${this.content}&type=markdown`,
|
||||
body: `pushkey=${pushDeerKey}&text=${
|
||||
this.title
|
||||
}&desp=${encodeURIComponent(this.content)}&type=markdown`,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
.json();
|
||||
|
|
Loading…
Reference in New Issue
Block a user