| | |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.RegisterBody; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.exception.user.CaptchaException; |
| | | import com.ruoyi.common.exception.user.CaptchaExpireException; |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private AsyncService asyncService; |
| | |
| | | public void validateCaptcha(String username, String code, String uuid) |
| | | { |
| | | String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; |
| | | String captcha = redisCache.getCacheObject(verifyKey); |
| | | redisCache.deleteObject(verifyKey); |
| | | String captcha = RedisUtils.getCacheObject(verifyKey); |
| | | RedisUtils.deleteObject(verifyKey); |
| | | if (captcha == null) |
| | | { |
| | | throw new CaptchaExpireException(); |