Skip to content

Commit

Permalink
Merge pull request iDerekLi#103 from iDerekLi/dev
Browse files Browse the repository at this point in the history
fix: 修复通知推送套件
  • Loading branch information
iDerekLi authored Jan 15, 2023
2 parents 28eaba8 + d9f49f4 commit e633c19
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions workflows/utils/notification-kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export class NotificationKit {
* @param options
*/
async pushplus(options: PushPlusOptions) {
const token: string | undefined = env.PUSHPLUS_TOKEN;
if (typeof token !== "string") {
const token: string | unknown = env.PUSHPLUS_TOKEN;
if (token) {
throw new Error("未配置PushPlus Token。");
}

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

return axios.post(url, {
return axios.post(url as string, {
msgtype: "text",
text: {
content: `${options.title}\n${options.content}`
Expand All @@ -156,12 +156,12 @@ export class NotificationKit {
* @param options
*/
async wecomWebhook(options: WeComOptions) {
const url: string | undefined = env.WEIXIN_WEBHOOK;
if (typeof url !== "string") {
const url: string | unknown = env.WEIXIN_WEBHOOK;
if (url) {
throw new Error("未配置企业微信Webhook。");
}

return axios.post(url, {
return axios.post(url as string, {
msgtype: "text",
text: {
content: `${options.title}\n${options.content}`
Expand Down

0 comments on commit e633c19

Please sign in to comment.