فهرست منبع

优化webhook通知

zhouhao 2 سال پیش
والد
کامیت
9975d3ea00

+ 4 - 5
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<HttpWebHookTemplate> {
     //todo 增加认证类型, oauth2等
 
     public String resolveBody(Values context) {
-        if (!StringUtils.hasText(body)) {
-            return body;
-        }
+
+        Map<String, Object> contextVal = renderMap(context.getAllValues());
+
         if (contextAsBody) {
-            return JSON.toJSONString(context.getAllValues());
+            return JSON.toJSONString(contextVal);
         }
-        Map<String, Object> contextVal = context.getAllValues();
 
         try {
             if (bodyIsJson == null || bodyIsJson) {