瀏覽代碼

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