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 { export class BarkNotification extends NotificationBaseInfo {
public barkPush = ''; public barkPush = '';
public barkIcon = 'https://lf9-survey.bytetos.com/obj/web.business.image/202201205d0d7b5e576ee603497ab6f3';
public barkSound = ''; public barkSound = '';
public barkGroup = 'qinglong'; public barkGroup = 'qinglong';
} }

View File

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

View File

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