diff --git a/back/data/notify.ts b/back/data/notify.ts index a28e0721..aa4887b9 100644 --- a/back/data/notify.ts +++ b/back/data/notify.ts @@ -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'; } diff --git a/back/services/notify.ts b/back/services/notify.ts index 84119d7c..1a12abd0 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -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, diff --git a/src/utils/config.ts b/src/utils/config.ts index 0b21d04f..3a5d4a04 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -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' }, ],