From 7de83d12a5113818066fa70d2d861ce8d85afc8d Mon Sep 17 00:00:00 2001 From: guojing1983 <60596094+guojing1983@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:45:50 +0800 Subject: [PATCH] [Fix BUG : use Enterprise WeChat APP alarm notification,log print invalid access token ] (#1040) --- .../alerter/impl/WeChatAppAlertNotifyHandlerImpl.java | 4 ++-- .../app/routes/alert/alert-notice/alert-notice.component.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAppAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAppAlertNotifyHandlerImpl.java index 3b4871ae532..643f3165b9e 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAppAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAppAlertNotifyHandlerImpl.java @@ -73,8 +73,8 @@ public void send(NoticeReceiver receiver, Alert alert) throws AlertNoticeExcepti HttpEntity weChatAppEntity = new HttpEntity<>(weChatAppDTO, headers); ResponseEntity response = restTemplate.postForEntity(String.format(APP_MESSAGE_URL, accessToken), weChatAppEntity, WeChatAppReq.class); if (Objects.nonNull(response.getBody()) && !Objects.equals(response.getBody().getErrCode(), 0)) { - log.warn("Send Enterprise WeChat App Error: {} Failed: {}", receiver.getHookUrl(), response.getBody().getErrMsg()); - throw new AlertNoticeException("Http StatusCode " + response.getStatusCode()); + log.warn("Send Enterprise WeChat App Error: {}", response.getBody().getErrMsg()); + throw new AlertNoticeException("Http StatusCode " + response.getStatusCode() + " Error: " + response.getBody().getErrMsg()); } } } catch (Exception e) { 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 bd461e1063c..f31b200a297 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 @@ -347,7 +347,7 @@ {{ 'alert.notice.type.weChatApp-corpId' | i18n }} - +