Skip to content

Commit

Permalink
fix(core/utils): update notifier req
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Nov 1, 2022
1 parent 09ea633 commit a45b35f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/core/src/utils/notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ const saveNotifications = (args: Array<any>) => {
notifications.push(`${log} ${at ?? ''}`)
}

const notify = async function(addtionalMessage: string) {
const notify = async function (addtionalMessage: string) {
const notifyConf: UsersConf['notifier'] = sstore.get('notifier')
if (!notifyConf?.length) {
return
}
const [pushPlatform, pushToken, groupNumber] = notifyConf
const content = `${notifications.join(`<br>`)}<br>${
addtionalMessage.replace(/\n/g, '<br>').replace(/\s/g, '&nbsp')
}`
const content = `${notifications.join(`<br>`)}<br>${addtionalMessage
.replace(/\n/g, '<br>')
.replace(/\s/g, '&nbsp')}`
const url = pushEndpoints[Number(pushPlatform)]
if (pushToken && url) {
await fetch(url, {
Expand All @@ -31,7 +31,8 @@ const notify = async function(addtionalMessage: string) {
content,
token: pushToken,
title: 'Cea.js 消息推送服务',
topic: groupNumber,
template: 'html',
channel: 'wechat',
}),
})
}
Expand Down

0 comments on commit a45b35f

Please sign in to comment.