Skip to content

Commit

Permalink
Merge pull request iDerekLi#104 from iDerekLi/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
iDerekLi authored Jan 15, 2023
2 parents e633c19 + d2fc7dd commit a5e323f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions workflows/utils/notification-kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class NotificationKit {
pass: env.EMAIL_PASS // generated ethereal password
};

if (!auth.user || !auth.pass) {
if (!auth.user || !auth.pass || auth.user === "" || auth.pass === "") {
throw new Error("邮箱功能不可用, 请先配置邮箱用户和密码。");
}

Expand Down Expand Up @@ -109,7 +109,7 @@ export class NotificationKit {
*/
async pushplus(options: PushPlusOptions) {
const token: string | unknown = env.PUSHPLUS_TOKEN;
if (token) {
if (!token || token === "") {
throw new Error("未配置PushPlus Token。");
}

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

Expand All @@ -148,7 +148,6 @@ export class NotificationKit {
content: `${options.title}\n${options.content}`
}
});
// .then(res => console.log(JSON.stringify(res.data)));
}

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

Expand Down

0 comments on commit a5e323f

Please sign in to comment.