|
@@ -89,13 +89,16 @@ public class HuaweiSmsServiceImpl implements ISmsService {
|
|
|
}
|
|
}
|
|
|
String redisCodeKey = REDIS_KEY_CODE + phone;
|
|
String redisCodeKey = REDIS_KEY_CODE + phone;
|
|
|
String codeValue = redisTemplate.opsForValue().get(redisCodeKey);
|
|
String codeValue = redisTemplate.opsForValue().get(redisCodeKey);
|
|
|
- if(codeValue!=null){
|
|
|
|
|
- return R.data("已获取过验证码,请到手机短信复制验证码");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if(codeValue!=null){
|
|
|
|
|
+// return R.data("已获取过验证码,请到手机短信复制验证码");
|
|
|
|
|
+// }
|
|
|
try{
|
|
try{
|
|
|
-
|
|
|
|
|
- String code = ramdomTemplateParam();
|
|
|
|
|
- String templateParas = "["+code+","+CODE_VALIDATE_TIME+"]"; //模板变量,此处以单变量验证码短信为例,请客户自行生成6位验证码,并定义为字符串类型,以杜绝首位0丢失的问题(例如:002569变成了2569)。
|
|
|
|
|
|
|
+ String code = codeValue;
|
|
|
|
|
+ if (codeValue ==null) {
|
|
|
|
|
+ code = ramdomTemplateParam();
|
|
|
|
|
+ }
|
|
|
|
|
+ //模板变量,此处以单变量验证码短信为例,请客户自行生成6位验证码,并定义为字符串类型,以杜绝首位0丢失的问题(例如:002569变成了2569)。
|
|
|
|
|
+ String templateParas = "["+code+","+CODE_VALIDATE_TIME+"]";
|
|
|
|
|
|
|
|
//请求Body,不携带签名名称时,signature请填null
|
|
//请求Body,不携带签名名称时,signature请填null
|
|
|
String body = buildRequestBody(sender, phone, templateId, templateParas,"", signature);
|
|
String body = buildRequestBody(sender, phone, templateId, templateParas,"", signature);
|