mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
完善pushplus通知方式的代码逻辑 (#2454)
* 1. pushplus通知方式返回结果优化 2. pushplus通知方式适配更多参数 * 细节bug修改 * 删除没用的空格 --------- Co-authored-by: 陈思远 <chensiyuan@yiban.com.cn> Co-authored-by: 陈大人 <chensiyuan@pushplus.plus>
This commit is contained in:
+17
-10
@@ -522,19 +522,26 @@ export default class NotificationService {
|
||||
}
|
||||
|
||||
private async pushPlus() {
|
||||
const { pushPlusToken, pushPlusUser } = this.params;
|
||||
const { pushPlusToken, pushPlusUser, pushplusWebhook, pushPlusTemplate, pushplusChannel, pushplusCallbackUrl, pushplusTo} = this.params;
|
||||
const url = `https://www.pushplus.plus/send`;
|
||||
try {
|
||||
let body = {
|
||||
...this.gotOption,
|
||||
json: {
|
||||
token: `${pushPlusToken}`,
|
||||
title: `${this.title}`,
|
||||
content: `${this.content.replace(/[\n\r]/g, '<br>')}`,
|
||||
topic: `${pushPlusUser || ''}`,
|
||||
template: `${pushPlusTemplate || 'html'}`,
|
||||
channel: `${pushplusChannel || 'wechat'}`,
|
||||
webhook: `${pushplusWebhook || ''}`,
|
||||
callbackUrl: `${pushplusCallbackUrl || ''}`,
|
||||
to: `${pushplusTo || ''}`
|
||||
},
|
||||
}
|
||||
|
||||
const res: any = await got
|
||||
.post(url, {
|
||||
...this.gotOption,
|
||||
json: {
|
||||
token: `${pushPlusToken}`,
|
||||
title: `${this.title}`,
|
||||
content: `${this.content.replace(/[\n\r]/g, '<br>')}`,
|
||||
topic: `${pushPlusUser || ''}`,
|
||||
},
|
||||
})
|
||||
.post(url, body)
|
||||
.json();
|
||||
|
||||
if (res.code === 200) {
|
||||
|
||||
Reference in New Issue
Block a user