From 1c0d518fdb2a785b7534788d6e2878f1dd116e80 Mon Sep 17 00:00:00 2001 From: LiYaoheng Date: Mon, 4 Nov 2024 17:07:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20luosimao=E7=9A=84=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E4=B8=8D=E9=9C=80=E8=A6=81+86=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/sms4j/luosimao/utils/LuoSiMaoUtils.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sms4j-provider/src/main/java/org/dromara/sms4j/luosimao/utils/LuoSiMaoUtils.java b/sms4j-provider/src/main/java/org/dromara/sms4j/luosimao/utils/LuoSiMaoUtils.java index 3f3a6356..ece889be 100644 --- a/sms4j-provider/src/main/java/org/dromara/sms4j/luosimao/utils/LuoSiMaoUtils.java +++ b/sms4j-provider/src/main/java/org/dromara/sms4j/luosimao/utils/LuoSiMaoUtils.java @@ -1,6 +1,5 @@ package org.dromara.sms4j.luosimao.utils; -import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import org.dromara.sms4j.comm.constant.Constant; import org.dromara.sms4j.comm.utils.SmsDateUtils; @@ -13,24 +12,24 @@ import java.util.List; @Slf4j public class LuoSiMaoUtils { - public static LinkedHashMap buildHeaders(){ + public static LinkedHashMap buildHeaders() { LinkedHashMap headers = new LinkedHashMap<>(1); headers.put(Constant.CONTENT_TYPE, Constant.APPLICATION_FROM_URLENCODED); return headers; } - public static LinkedHashMap buildBody(String phone, String message){ + public static LinkedHashMap buildBody(String phone, String message) { LinkedHashMap body = new LinkedHashMap<>(2); - body.put("mobile", StrUtil.addPrefixIfNot(phone, "+86")); + body.put("mobile", phone); body.put("message", message); return body; } - public static LinkedHashMap buildBody(List phones, String message, Date date){ + public static LinkedHashMap buildBody(List phones, String message, Date date) { LinkedHashMap body = new LinkedHashMap<>(2); - body.put("mobile", SmsUtils.addCodePrefixIfNot(phones)); + body.put("mobile", SmsUtils.joinComma(phones)); body.put("message", message); - if (date != null){ + if (date != null) { body.put("time", SmsDateUtils.normDatetimeGmt8(date)); } return body;