| | |
| | | package com.ruoyi.auth.utils; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | |
| | | |
| | | public static void smsSendBatch(List<String> mobileList, String content, |
| | | String ext, String attime) { |
| | | log.info("发送短信:号码{},内容:{}", JSONObject.toJSONString(mobileList), content); |
| | | for (String mobile : mobileList) { |
| | | String errMess = ""; |
| | | StringBuffer sendData = new StringBuffer(""); |
| | |
| | | sendData.append("&password=").append(pwd); // 密码 |
| | | |
| | | sendData.append("&encode=").append("GBK"); // encode=GBK或者encode=utf8 |
| | | content = template.replace("${code}", content); |
| | | String contentBase64 = Base64.getEncoder() |
| | | .encodeToString(content.getBytes("gbk"));// 先用encode中定义的格式编码,再用base64加密内容 |
| | | sendData.append("&encodeType=base64"); // 固定 |