集成 Spring Security 组件,重构后,整体逻辑更加清晰

This commit is contained in:
YunaiV
2021-01-03 12:15:16 +08:00
parent ee9a358b11
commit fc8eac548a
27 changed files with 1821 additions and 177 deletions

View File

@@ -0,0 +1,21 @@
package cn.iocoder.dashboard.modules.system.enums;
import cn.iocoder.dashboard.common.exception.ErrorCode;
/**
* 错误码枚举类
*
* system 系统,使用 1-002-000-000 段
*/
public interface SysErrorCodeConstants {
// ========== AUTH 模块 1002000000 ==========
ErrorCode AUTH_LOGIN_BAD_CREDENTIALS = new ErrorCode(1002000000, "登录失败,账号密码不正确");
ErrorCode AUTH_LOGIN_USER_DISABLED = new ErrorCode(1002000001, "登录失败,账号被禁用");
ErrorCode AUTH_LOGIN_FAIL_UNKNOWN = new ErrorCode(1002000002, "登录失败"); // 登陆失败的兜底,位置原因
// ========== TOKEN 模块 1002001000 ==========
ErrorCode TOKEN_EXPIRED = new ErrorCode(1002001000, "Token 已经过期");
ErrorCode TOKEN_PARSE_FAIL = new ErrorCode(1002001001, "Token 解析失败");
}

View File

@@ -0,0 +1,30 @@
package cn.iocoder.dashboard.modules.system.enums.user;
/**
* 用户状态
*
* @author ruoyi
*/
public enum UserStatus
{
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
private final String code;
private final String info;
UserStatus(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}