فهرست منبع

短信发送模板

zhaopeiqing 3 سال پیش
والد
کامیت
11d5cf0393

+ 1 - 1
src/main/java/com/ssm/controller/business/SendMessageContorller.java

@@ -224,7 +224,7 @@ public class SendMessageContorller {
 			request.setCharacterEncoding("utf-8");
 			String smsUserPhones = request.getParameter("phones");
 			String content = request.getParameter("contents");
-			Integer templateId = Integer.parseInt(request.getParameter("templateId").toString());
+			String templateId = request.getParameter("templateid");
 			String res = SmsUtil.sendTemplateSmsPost(smsUserPhones, content, templateId);
 			Map mapObj = JSON.parseObject(res, Map.class);
 			String msgNo = mapObj.get("msg_no").toString();

+ 1 - 1
src/main/java/com/ssm/util/sms/SmsUtil.java

@@ -123,7 +123,7 @@ public class SmsUtil {
 	 * @param templateId 模板id
 	 * @return res    json返回值
 	 */
-	public static String sendTemplateSmsPost(String phones, String content, Integer templateId) throws IOException {
+	public static String sendTemplateSmsPost(String phones, String content, String templateId) throws IOException {
 		HttpClient httpClient = HttpClients.createDefault();
 		HttpPost httpPost = new HttpPost("https://api.4321.sh/sms/template");
 		httpPost.addHeader("Content-Type", "application/json");