Commit ea3f94d0 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents d0adcdd0 19805785
...@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
//@FeignClient(value = "${auth.serviceId}",configuration = {}) //@FeignClient(value = "${auth.serviceId}",configuration = {})
@FeignClient("xx-app") @FeignClient("xx-app")
public interface ConfigFeign { public interface ConfigFeign {
@RequestMapping(value = "/cofig/types/{types}",method = RequestMethod.GET) @RequestMapping(value = "/cofig/app/unauth/types",method = RequestMethod.GET)
public ObjectRestResponse<Cofig> getAllByType(String types); public ObjectRestResponse<Cofig> getAllByType(String types);
} }
...@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.RandomUtil; ...@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.RandomUtil;
import com.github.wxiaoqi.security.common.util.process.SystemConfig; import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -45,6 +46,9 @@ public class SmsService { ...@@ -45,6 +46,9 @@ public class SmsService {
public JSONObject smsCode(String mobile){ public JSONObject smsCode(String mobile){
String code = RandomUtil.getRandomStr(6);// 6位短信验证码 String code = RandomUtil.getRandomStr(6);// 6位短信验证码
try { try {
if(StringUtils.isNotBlank(mobile)){
mobile=mobile.replace(" ", "");
}
code=sendSms(mobile,code); code=sendSms(mobile,code);
return JsonResultUtil.createSuccessResultWithObj(code); return JsonResultUtil.createSuccessResultWithObj(code);
} catch (ClientException e) { } catch (ClientException e) {
...@@ -83,7 +87,7 @@ public class SmsService { ...@@ -83,7 +87,7 @@ public class SmsService {
//request.setOutId("yourOutId"); //request.setOutId("yourOutId");
//hint 此处可能会抛出异常,注意catch //hint 此处可能会抛出异常,注意catch
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
log.info("短信接口返回的数据----------------"); log.info("短信接口返回的数据----------------mobile======"+mobile+"----code===="+code);
log.info("Code=" + sendSmsResponse.getCode()); log.info("Code=" + sendSmsResponse.getCode());
log.info("Message=" + sendSmsResponse.getMessage()); log.info("Message=" + sendSmsResponse.getMessage());
log.info("RequestId=" + sendSmsResponse.getRequestId()); log.info("RequestId=" + sendSmsResponse.getRequestId());
...@@ -131,7 +135,7 @@ public class SmsService { ...@@ -131,7 +135,7 @@ public class SmsService {
public static void main(String[] args) throws ClientException, InterruptedException { public static void main(String[] args) throws ClientException, InterruptedException {
SmsService SmsService=new SmsService(); SmsService SmsService=new SmsService();
//发短信 //发短信
String response = SmsService.sendSms("13612688539","123456"); String response = SmsService.sendSms("15521075918","123456");
/*System.out.println("短信接口返回的数据----------------"); /*System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode()); System.out.println("Code=" + response.getCode());
System.out.println("Message=" + response.getMessage()); System.out.println("Message=" + response.getMessage());
......
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