Commit 8ec91319 authored by liuyang's avatar liuyang

update

parent 65786dce
...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service; ...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Base64; import java.util.Base64;
import java.util.Collections; import java.util.Collections;
...@@ -53,6 +54,7 @@ public class SmsService { ...@@ -53,6 +54,7 @@ public class SmsService {
} }
content = Base64.getUrlEncoder().encodeToString(content.getBytes("UTF-8")); content = Base64.getUrlEncoder().encodeToString(content.getBytes("UTF-8"));
content = URLEncoder.encode(content,"utf-8");
String url = String.format(api, condition.getMobile(), content); String url = String.format(api, condition.getMobile(), content);
log.debug("sms req url:" + url); log.debug("sms req url:" + url);
ResponseEntity<String> resp = restTemplate.getForEntity(url, String.class); ResponseEntity<String> resp = restTemplate.getForEntity(url, String.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment