| | |
| | | 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; |
| | | |
| | |
| | | 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) { |