|
@@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.llisoft.common.exception.MtaException;
|
|
|
-import com.llisoft.common.util.RandomUtil;
|
|
|
+import com.llisoft.common.util.CodeUtil;
|
|
|
import com.llisoft.service.sms.util.RedisUtil;
|
|
|
|
|
|
/**
|
|
@@ -53,7 +53,7 @@ public class SmsService {
|
|
|
throw new MtaException("此号码被限制发送:" + phone);
|
|
|
}
|
|
|
// 发送短信
|
|
|
- String code = String.valueOf(RandomUtil.getRandomInt(4));
|
|
|
+ String code = String.valueOf(CodeUtil.ints(4));
|
|
|
RedisUtil.set(phone + "_" + code, "", 10, TimeUnit.MINUTES); // 有效期10分钟
|
|
|
logger.info("发送验证码: {}", code);
|
|
|
aliyunService.sms(phone, code); // 第三方发送短信
|