bark添加自定义推送图标

This commit is contained in:
Ukenn 2022-02-08 00:14:19 +08:00
parent 25689cf40f
commit 8217a53fcf
3 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,7 @@ export class ServerChanNotification extends NotificationBaseInfo {
export class BarkNotification extends NotificationBaseInfo {
public barkPush = '';
public barkIcon = 'https://lf9-survey.bytetos.com/obj/web.business.image/202201205d0d7b5e576ee603497ab6f3';
public barkSound = '';
public barkGroup = 'qinglong';
}

View File

@ -119,7 +119,7 @@ export default class NotificationService {
}
private async bark() {
let { barkPush, barkSound, barkGroup } = this.params;
let { barkPush, barkIcon, barkSound, barkGroup } = this.params;
if (!barkPush.startsWith('http') && !barkPush.startsWith('https')) {
barkPush = `https://api.day.app/${barkPush}`;
}
@ -127,7 +127,7 @@ export default class NotificationService {
this.title,
)}/${encodeURIComponent(
this.content,
)}?sound=${barkSound}&group=${barkGroup}`;
)}?icon=${barkIcon}?sound=${barkSound}&group=${barkGroup}`;
const res: any = await got
.get(url, {
timeout: this.timeout,

View File

@ -119,6 +119,7 @@ export default {
tip: 'Bark的信息IP/设备码例如https://api.day.app/XXXXXXXX',
required: true,
},
{ label: 'barkIcon', tip: 'BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)' },
{ label: 'barkSound', tip: 'BARK推送铃声,铃声列表去APP查看复制填写' },
{ label: 'barkGroup', tip: 'BARK推送消息的分组, 默认为qinglong' },
],