登陆代码迁移

This commit is contained in:
houjishuang
2025-06-11 10:13:31 +08:00
parent 90cfebee04
commit 0bebd971ef

View File

@ -88,16 +88,16 @@ public class BaseUserServiceImpl extends BaseServiceImpl<BaseUserMapper, SysUser
byte[] decode = RSA.decryptByPrivateKey(RSA.decryptBASE64(password), privateKey); byte[] decode = RSA.decryptByPrivateKey(RSA.decryptBASE64(password), privateKey);
String pw = new String(decode); String pw = new String(decode);
System.out.println("公钥解密结果:" + pw);
if (!this.encode(pw).equals(user.getPassword())) { if (!this.encode(pw).equals(user.getPassword())) {
throw new RuntimeException("认证密码错误!"); throw new RuntimeException("用户名或密码错误!");
} }
return userLogin(user); return userLogin(user);
}catch (BadPaddingException e){ }catch (BadPaddingException e){
log.error("RSA解密异常",e); log.error("RSA解密异常",e);
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("认证密码错误",true); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("用户名或密码错误",true);
}catch (Exception e){ }catch (Exception e){
log.error("登录异常",e); log.error("登录异常",e);
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName(e.getMessage(),true); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName(e.getMessage(),true);