From 309e5a57dcf4be3c3f235e11d001fec3a307ebe6 Mon Sep 17 00:00:00 2001 From: bestfeng1020 <31398465+bestfeng1020@users.noreply.github.com> Date: Thu, 4 May 2023 16:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E8=BF=87=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E8=81=94=E5=8A=A8=E5=8F=91=E9=80=81=E9=98=BF=E9=87=8C?= =?UTF-8?q?=E4=BA=91=E7=9F=AD=E4=BF=A1=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#279)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/notify/sms/aliyun/AliyunSmsTemplate.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jetlinks-components/notify-component/notify-sms/src/main/java/org/jetlinks/community/notify/sms/aliyun/AliyunSmsTemplate.java b/jetlinks-components/notify-component/notify-sms/src/main/java/org/jetlinks/community/notify/sms/aliyun/AliyunSmsTemplate.java index 63da4da77..254622aa8 100755 --- a/jetlinks-components/notify-component/notify-sms/src/main/java/org/jetlinks/community/notify/sms/aliyun/AliyunSmsTemplate.java +++ b/jetlinks-components/notify-component/notify-sms/src/main/java/org/jetlinks/community/notify/sms/aliyun/AliyunSmsTemplate.java @@ -1,6 +1,7 @@ package org.jetlinks.community.notify.sms.aliyun; import com.alibaba.fastjson.JSON; +import com.google.common.collect.Maps; import lombok.Getter; import lombok.Setter; import org.jetlinks.core.metadata.types.StringType; @@ -64,7 +65,10 @@ public String getSignName(Map ctx) { } public String createTtsParam(Map ctx) { - return JSON.toJSONString(ctx); + Map variables = getVariables(); + return JSON.toJSONString(Maps.filterEntries( + renderMap(ctx), + e -> variables.containsKey(e.getKey()))); } @Override