Skip to content

Commit

Permalink
chore: 移除通知测试
Browse files Browse the repository at this point in the history
  • Loading branch information
iDerekLi committed Jan 15, 2023
1 parent aad75fc commit d2fc7dd
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions workflows/utils/notification-kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ export class NotificationKit {
*/
async pushplus(options: PushPlusOptions) {
const token: string | unknown = env.PUSHPLUS_TOKEN;
console.log("pushplus", !token || token === "", typeof token);

if (!token || token === "") {
throw new Error("未配置PushPlus Token。");
}
Expand Down Expand Up @@ -140,27 +138,16 @@ export class NotificationKit {
*/
async dingtalkWebhook(options: DingTalkOptions) {
const url: string | unknown = env.DINGDING_WEBHOOK;
console.log("钉钉", !url || url === "", typeof url);
if (!url || url === "") {
throw new Error("未配置钉钉Webhook。");
}

return axios
.post(
url as string,
{
msgtype: "text",
text: {
content: `${options.title}\n${options.content}`
}
},
{
headers: {
"Content-Type": "application/json"
}
}
)
.then(res => JSON.stringify(res.data));
return axios.post(url as string, {
msgtype: "text",
text: {
content: `${options.title}\n${options.content}`
}
});
}

/**
Expand All @@ -169,7 +156,6 @@ export class NotificationKit {
*/
async wecomWebhook(options: WeComOptions) {
const url: string | unknown = env.WEIXIN_WEBHOOK;
console.log("微信", !url || url === "", typeof url);
if (!url || url === "") {
throw new Error("未配置企业微信Webhook。");
}
Expand Down

0 comments on commit d2fc7dd

Please sign in to comment.