|
|
@ -2,6 +2,7 @@ package com.ruoyi.resource.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.constant.CacheConstants;
|
|
|
|
import com.ruoyi.common.core.constant.Constants;
|
|
|
|
import com.ruoyi.common.core.constant.Constants;
|
|
|
|
import com.ruoyi.common.core.domain.R;
|
|
|
|
import com.ruoyi.common.core.domain.R;
|
|
|
|
import com.ruoyi.common.core.utils.SpringUtils;
|
|
|
|
import com.ruoyi.common.core.utils.SpringUtils;
|
|
|
@ -46,7 +47,7 @@ public class SysSmsController extends BaseController {
|
|
|
|
if (smsProperties.getEnabled()) {
|
|
|
|
if (smsProperties.getEnabled()) {
|
|
|
|
R.fail("当前系统没有开启短信功能!");
|
|
|
|
R.fail("当前系统没有开启短信功能!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String key = Constants.CAPTCHA_CODE_KEY + phonenumber;
|
|
|
|
String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber;
|
|
|
|
String code = RandomUtil.randomNumbers(4);
|
|
|
|
String code = RandomUtil.randomNumbers(4);
|
|
|
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
|
|
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
|
|
|
// 验证码模板id 自行处理 (查数据库或写死均可)
|
|
|
|
// 验证码模板id 自行处理 (查数据库或写死均可)
|
|
|
|