修复自定义通知

This commit is contained in:
whyour 2023-03-07 22:20:08 +08:00
parent 98dfa4c425
commit b2167ae5e4
3 changed files with 6 additions and 5 deletions

View File

@ -41,6 +41,7 @@ export default async () => {
}
// 运行所有订阅
await subscriptionService.setSshConfig();
const subs = await subscriptionService.list();
for (const sub of subs) {
subscriptionService.handleTask(sub, !sub.is_disabled, !sub.is_disabled);

View File

@ -484,11 +484,11 @@ export default class NotificationService {
return {
formatUrl: url
.replaceAll('$title', encodeURIComponent(this.title))
.replaceAll('$content', encodeURIComponent(this.content)),
?.replaceAll('$title', encodeURIComponent(this.title))
?.replaceAll('$content', encodeURIComponent(this.content)),
formatBody: body
.replaceAll('$title', this.title)
.replaceAll('$content', this.content),
?.replaceAll('$title', this.title)
?.replaceAll('$content', this.content),
};
}
}

View File

@ -104,7 +104,7 @@ export default class SubscriptionService {
}
}
private async setSshConfig() {
public async setSshConfig() {
const docs = await SubscriptionModel.findAll();
this.sshKeyService.setSshConfig(docs);
}