|
@@ -261,16 +261,16 @@ public class MobileServiceImpl implements MobileService {
|
|
|
final String key = CacheConstants.DEFAULT_CODE_KEY + LoginTypeEnum.SMS.getType() + StringPool.AT + mobile + "@fina";
|
|
|
Object code = redisTemplate.opsForValue().get(key);
|
|
|
|
|
|
- code = Objects.isNull(code) ? (need ? RandomUtil.randomNumbers(Integer.parseInt(SecurityConstants.CODE_SIZE)) : "5657") : code;
|
|
|
+ final String codeStr = Objects.isNull(code) ? (need ? RandomUtil.randomNumbers(Integer.parseInt(SecurityConstants.CODE_SIZE)) : "5657") : code.toString();
|
|
|
|
|
|
boolean res = false;
|
|
|
try {
|
|
|
if (need) {
|
|
|
- res = SendSms.sendSmsCode1(mobile, code);
|
|
|
+ res = SendSms.sendSmsCode1(mobile, codeStr);
|
|
|
}
|
|
|
- log.debug("手机号生成验证码成功:{},{}", mobile, code);
|
|
|
+ log.debug("手机号生成验证码成功:{},{}", mobile, codeStr);
|
|
|
|
|
|
- redisTemplate.opsForValue().set(key, code, SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
|
|
+ redisTemplate.opsForValue().set(key, codeStr, SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
|
|
} catch (ClientException | InterruptedException e) {
|
|
|
log.error("手机号生成验证码失败", e);
|
|
|
}
|