diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html index 7662cbf6424..926c64760b2 100644 --- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html +++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html @@ -274,7 +274,14 @@ 'alert.notice.type.wework-key' | i18n }} - + @@ -282,7 +289,14 @@ 'alert.notice.type.access-token' | i18n }} - + @@ -290,7 +304,14 @@ 'alert.notice.type.fei-shu-key' | i18n }} - + diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts index ef990b15875..82ac540e23f 100644 --- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts +++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts @@ -160,6 +160,36 @@ export class AlertNoticeComponent implements OnInit { isSendTestButtonLoading: boolean = false; receiver!: NoticeReceiver; + onSplitTokenStr(type: number) { + let index = -1; + switch (this.receiver?.type) { + case 4: + if (this.receiver?.wechatId) { + index = this.receiver.wechatId.indexOf('key='); + if (index > 0) { + this.receiver.wechatId = this.receiver.wechatId.substring(index + 4); + } + } + break; + case 5: + if (this.receiver?.accessToken) { + index = this.receiver.accessToken.indexOf('access_token='); + if (index > 0) { + this.receiver.accessToken = this.receiver.accessToken.substring(index + 13); + } + } + break; + case 6: + if (this.receiver?.wechatId) { + index = this.receiver.wechatId.indexOf('hook'); + if (index > 0) { + this.receiver.wechatId = this.receiver.wechatId.substring(index + 5); + } + } + break; + } + } + onNewNoticeReceiver() { this.receiver = new NoticeReceiver(); this.isManageReceiverModalVisible = true;