Commit bfd26b2d by 伍思炜

修复redis问题

parent d423d718
......@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
......@@ -59,7 +60,7 @@ public class codeManagerController extends BaseController {
@Autowired
private AuthCodeMapper authCodeMapper;
@Autowired
@Qualifier("redisStringTemplate")
// @Qualifier("redisStringTemplate")
private RedisTemplate redisTemplate;
@Autowired
private ProductMapper productMapper;
......@@ -75,6 +76,9 @@ public class codeManagerController extends BaseController {
@Autowired
private SaveAuthCodeUtil saveAuthCodeUtil;
@Autowired
private StringRedisTemplate stringRedisTemplate;
private static String PATH1 = "StudentCard1";
private static String PATH2 = "StudentCard2";
......@@ -164,7 +168,7 @@ public class codeManagerController extends BaseController {
try {
// 生成6位随机数
int veCode = (int) ((RandomUtil.getSecrityRandom() * 9 + 1) * 100000);
redisTemplate.opsForValue().set(phone, String.valueOf(veCode), 30, TimeUnit.MINUTES);
stringRedisTemplate.opsForValue().set(phone, String.valueOf(veCode), 30, TimeUnit.MINUTES);
saveAuthCodeUtil.saveAuthCode(phone, String.valueOf(veCode)); // 临时保存数据库
SendSmsAndMail.sendSms(phone, veCode + "", null, "7");
log.info("验证码:" + veCode);
......
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