接入登陆日志

This commit is contained in:
YunaiV
2021-01-18 00:23:20 +08:00
parent cbb11986b4
commit 083dac77e1
17 changed files with 236 additions and 52 deletions

View File

@@ -13,6 +13,8 @@ public interface SysErrorCodeConstants {
ErrorCode AUTH_LOGIN_BAD_CREDENTIALS = new ErrorCode(1002000000, "登录失败,账号密码不正确");
ErrorCode AUTH_LOGIN_USER_DISABLED = new ErrorCode(1002000001, "登录失败,账号被禁用");
ErrorCode AUTH_LOGIN_FAIL_UNKNOWN = new ErrorCode(1002000002, "登录失败"); // 登陆失败的兜底,位置原因
ErrorCode AUTH_LOGIN_CAPTCHA_NOT_FOUND = new ErrorCode(1002000003, "验证码不存在");
ErrorCode AUTH_LOGIN_CAPTCHA_CODE_ERROR = new ErrorCode(1002000004, "验证码不正确");
// ========== TOKEN 模块 1002001000 ==========
ErrorCode TOKEN_EXPIRED = new ErrorCode(1002001000, "Token 已经过期");

View File

@@ -0,0 +1,21 @@
package cn.iocoder.dashboard.modules.system.enums.logger;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 登陆日志的类型枚举
*/
@Getter
@AllArgsConstructor
public enum SysLoginLogTypeEnum {
LOGIN(1),
LOGOUT(2);
/**
* 日志类型
*/
private final Integer type;
}

View File

@@ -11,6 +11,12 @@ import lombok.Getter;
public enum SysLoginResultEnum {
SUCCESS(0), // 成功
BAD_CREDENTIALS(10), // 账号或密码不正确
USER_DISABLED(20), // 账号或密码不正确
CAPTCHA_NOT_FOUND(30), // 验证码不存在
CAPTCHA_CODE_ERROR(31), // 验证码不正确
UNKNOWN_ERROR(100), // 未知异常
;
/**