diff --git a/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts b/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts index 2d7d45dc..02526421 100644 --- a/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts @@ -47,26 +47,35 @@ export class QywxNotification extends BaseNotification { if (!this.webhook) { throw new Error('webhook地址不能为空'); } - /** - * - * "msgtype": "text", - * "text": { - * "content": "hello world" - * } - * } - */ - const color = body.errorMessage?'red':'green'; + await this.http.request({ url: this.webhook, method: 'POST', data: { - msgtype: 'markdown', - markdown: { - content: `${body.title}\n\n\n${body.content}\n\n[查看详情](${body.url})`, + msgtype: 'text', + text: { + content: `${body.title}\n${body.content}\n查看详情: ${body.url}`, mentioned_list: this.mentionedList, mentioned_mobile_list: this.mentionedMobileList, }, }, }); + + + //Markdown 模式不支持@ + + // const color = body.errorMessage?'red':'green'; + // await this.http.request({ + // url: this.webhook, + // method: 'POST', + // data: { + // msgtype: 'markdown', + // markdown: { + // content: `${body.title}\n\n\n${body.content}\n\n[查看详情](${body.url})`, + // mentioned_list: this.mentionedList, + // mentioned_mobile_list: this.mentionedMobileList, + // }, + // }, + // }); } }