|
@@ -4,6 +4,8 @@ import com.ruoyi.common.constant.Constants;
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
import com.ruoyi.common.exception.CustomException;
|
|
import com.ruoyi.common.exception.CustomException;
|
|
|
|
+import com.ruoyi.common.exception.user.CaptchaException;
|
|
|
|
+import com.ruoyi.common.exception.user.CaptchaExpireException;
|
|
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
|
|
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
|
|
import com.ruoyi.common.utils.MessageUtils;
|
|
import com.ruoyi.common.utils.MessageUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
@@ -51,14 +53,14 @@ public class SysLoginService {
|
|
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
|
|
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
|
|
String captcha = redisCache.getCacheObject(verifyKey);
|
|
String captcha = redisCache.getCacheObject(verifyKey);
|
|
redisCache.deleteObject(verifyKey);
|
|
redisCache.deleteObject(verifyKey);
|
|
- /*if (captcha == null) {
|
|
|
|
|
|
+ if (captcha == null) {
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
|
throw new CaptchaExpireException();
|
|
throw new CaptchaExpireException();
|
|
}
|
|
}
|
|
if (!code.equalsIgnoreCase(captcha)) {
|
|
if (!code.equalsIgnoreCase(captcha)) {
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
throw new CaptchaException();
|
|
throw new CaptchaException();
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
// 用户验证
|
|
// 用户验证
|
|
Authentication authentication = null;
|
|
Authentication authentication = null;
|
|
try {
|
|
try {
|