Commit a0f03874 authored by liuyang's avatar liuyang

update

parent 8ec91319
......@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLEncoder;
import java.util.Base64;
import java.util.Collections;
......@@ -57,7 +58,7 @@ public class SmsService {
content = URLEncoder.encode(content,"utf-8");
String url = String.format(api, condition.getMobile(), content);
log.debug("sms req url:" + url);
ResponseEntity<String> resp = restTemplate.getForEntity(url, String.class);
ResponseEntity<String> resp = restTemplate.getForEntity(URI.create(url), String.class);
if (resp.getStatusCode() != HttpStatus.OK || !resp.getBody().equals("OK")) {
log.error("短信发送失败:{}", resp.getBody());
throw new BusinessException("短信发送失败");
......
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