mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
完善登录历史
This commit is contained in:
@@ -33,6 +33,8 @@ public class DictCode {
|
||||
|
||||
public static final String LOGINUSERHIS_LOGINSTATUS = "loginUserHis.loginStatus";
|
||||
|
||||
public static final String LOGINUSERHIS_LOGINTYPE = "loginUserHis.loginType";
|
||||
|
||||
public static final String LOGINUSERHIS_LOGOUTTYPE = "loginUserHis.logoutType";
|
||||
|
||||
public static final String PERMISSION_TYPE = "permission.type";
|
||||
|
||||
@@ -24,13 +24,25 @@ public class LoginUserHisDto extends CommonDto {
|
||||
private String ua;
|
||||
private String captcha;
|
||||
|
||||
|
||||
@Comment("登录状态")
|
||||
private String status;
|
||||
private String loginType;
|
||||
|
||||
|
||||
|
||||
@DictTranslate(dictKey = DictCode.LOGINUSERHIS_LOGINTYPE)
|
||||
private String loginTypeName;
|
||||
|
||||
|
||||
|
||||
|
||||
@Comment("登录状态")
|
||||
private String loginStatus;
|
||||
|
||||
|
||||
|
||||
@DictTranslate(dictKey = DictCode.LOGINUSERHIS_LOGINSTATUS)
|
||||
private String statusName;
|
||||
private String loginStatusName;
|
||||
|
||||
@Comment("session id")
|
||||
private String sessionId;
|
||||
|
||||
@@ -317,7 +317,7 @@ public class SessionService {
|
||||
his.setUa(RequestUtils.getUa(request));
|
||||
his.setCaptcha(dto.getCaptcha());
|
||||
his.setUserName(dto.getUsername());
|
||||
his.setLoginStatus("1");
|
||||
his.setLoginStatus("0");
|
||||
his.setLocation(ipQueryService.query(his.getIp()));
|
||||
his.setLoginTime(LocalDateTime.now());
|
||||
his.setUser(user);
|
||||
@@ -335,6 +335,10 @@ public class SessionService {
|
||||
his.setUa(RequestUtils.getUa(request));
|
||||
his.setCaptcha(dto.getCaptcha());
|
||||
his.setUserName(dto.getUsername());
|
||||
|
||||
|
||||
|
||||
|
||||
his.setLoginStatus("1");
|
||||
his.setLocation(ipQueryService.query(his.getIp()));
|
||||
his.setLoginTime(LocalDateTime.now());
|
||||
|
||||
@@ -1891,6 +1891,21 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"code": "loginUserHis.loginType",
|
||||
"name": "登录类型",
|
||||
"item": [
|
||||
{
|
||||
"code": "0",
|
||||
"name": "账号密码"
|
||||
},
|
||||
{
|
||||
"code": "1",
|
||||
"name": "短信验证码"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"code": "loginUserHis.logoutType",
|
||||
"name": "登出类型",
|
||||
|
||||
Reference in New Issue
Block a user