44323
2024-06-06 b679205246bbe94e1e83db6f8e26d04668afd402
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/service/impl/TUserServiceImpl.java
@@ -10,7 +10,9 @@
import com.ruoyi.study.dto.AppUserQuery;
import com.ruoyi.study.mapper.TUserMapper;
import com.ruoyi.study.service.ITUserService;
import com.ruoyi.study.utils.HWSendSms;
import com.ruoyi.study.vo.AppUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@@ -40,12 +42,15 @@
        return this.baseMapper.listAll(query);
    }
    @Autowired
    private HWSendSms hwSendSms;
    @Override
    public Boolean phoneCode(String phone) {
    public Boolean phoneCode(String phone) throws Exception {
        // 生成随机 6位数字 验证码
        String phoneCode = RandomUtil.randomNumbers(6);
        // todo 手机验证码暂时 123456
        phoneCode = "123456";
//        phoneCode = "123456";
        hwSendSms.sendSms(phoneCode, phone);
        // 判断redis中是否存在手机验证码
        Object phoneCodeRedis = redisTemplate.opsForValue().get(RedisConstants.PHONE_CODE + phone);
        if (phoneCodeRedis == null) {