forked from dromara/Sa-Token
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
166 additions
and
11 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
sa-token-core/src/main/java/cn/dev33/satoken/exception/DisableLoginException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package cn.dev33.satoken.exception; | ||
|
||
/** | ||
* 一个异常:代表账号已被封禁 | ||
* | ||
* @author kong | ||
*/ | ||
public class DisableLoginException extends SaTokenException { | ||
|
||
/** | ||
* 序列化版本号 | ||
*/ | ||
private static final long serialVersionUID = 6806129545290130143L; | ||
|
||
/** 异常标记值 */ | ||
public static final String BE_VALUE = "disable"; | ||
|
||
/** 异常提示语 */ | ||
public static final String BE_MESSAGE = "此账号已被封禁"; | ||
|
||
/** | ||
* LoginKey | ||
*/ | ||
private String loginKey; | ||
|
||
/** | ||
* 被封禁的账号id | ||
*/ | ||
private Object loginId; | ||
|
||
/** | ||
* 封禁剩余时间,单位:秒 | ||
*/ | ||
private long disableTime; | ||
|
||
/** | ||
* 获得LoginKey | ||
* | ||
* @return See above | ||
*/ | ||
public String getLoginKey() { | ||
return loginKey; | ||
} | ||
|
||
/** | ||
* 获取: 被封禁的账号id | ||
* | ||
* @return See above | ||
*/ | ||
public Object getLoginId() { | ||
return loginId; | ||
} | ||
|
||
/** | ||
* 获取: 封禁剩余时间,单位:秒 | ||
* @return See above | ||
*/ | ||
public long getDisableTime() { | ||
return disableTime; | ||
} | ||
|
||
/** | ||
* 构造方法创建一个 | ||
* | ||
* @param loginKey loginKey | ||
* @param loginId 被封禁的账号id | ||
* @param disableTime 封禁剩余时间,单位:秒 | ||
*/ | ||
public DisableLoginException(String loginKey, Object loginId, long disableTime) { | ||
super(BE_MESSAGE); | ||
this.loginId = loginId; | ||
this.loginKey = loginKey; | ||
this.disableTime = disableTime; | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters