From 9975d3ea00c0867e5ce874085a826fa7c7f6fc7b Mon Sep 17 00:00:00 2001 From: zhouhao Date: Tue, 13 Dec 2022 18:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96webhook=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notify/webhook/http/HttpWebHookTemplate.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/jetlinks-components/notify-component/notify-webhook/src/main/java/org/jetlinks/community/notify/webhook/http/HttpWebHookTemplate.java b/jetlinks-components/notify-component/notify-webhook/src/main/java/org/jetlinks/community/notify/webhook/http/HttpWebHookTemplate.java index 954bdcbb..e5899534 100644 --- a/jetlinks-components/notify-component/notify-webhook/src/main/java/org/jetlinks/community/notify/webhook/http/HttpWebHookTemplate.java +++ b/jetlinks-components/notify-component/notify-webhook/src/main/java/org/jetlinks/community/notify/webhook/http/HttpWebHookTemplate.java @@ -42,13 +42,12 @@ public class HttpWebHookTemplate extends AbstractTemplate { //todo 增加认证类型, oauth2等 public String resolveBody(Values context) { - if (!StringUtils.hasText(body)) { - return body; - } + + Map contextVal = renderMap(context.getAllValues()); + if (contextAsBody) { - return JSON.toJSONString(context.getAllValues()); + return JSON.toJSONString(contextVal); } - Map contextVal = context.getAllValues(); try { if (bodyIsJson == null || bodyIsJson) {