mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
admin后台登录
This commit is contained in:
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpSession;
|
||||
public class SystemApi {
|
||||
|
||||
|
||||
public static final int STATUS_FORBIDDEN = 2;
|
||||
@Autowired
|
||||
AdminUserInfoMapper adminUserInfoMapper;
|
||||
|
||||
@@ -45,6 +46,9 @@ public class SystemApi {
|
||||
if (user == null) {
|
||||
throw AdminErrors.ERROR_USERNAME_PWD.getException();
|
||||
} else {
|
||||
if (user.getStatus() == STATUS_FORBIDDEN) {
|
||||
throw AdminErrors.USER_FORBIDDEN.getException();
|
||||
}
|
||||
SessionManager sessionManager = ApiContext.getSessionManager();
|
||||
// 生成一个新session
|
||||
HttpSession session = sessionManager.getSession(null);
|
||||
|
@@ -31,5 +31,7 @@ public class AdminErrors {
|
||||
public static final ErrorMeta ERROR_OPT = new ErrorMeta(isvModule, "10014", "非法操作");
|
||||
|
||||
public static final ErrorMeta NO_USER = new ErrorMeta(isvModule, "10015", "用户不存在");
|
||||
|
||||
public static final ErrorMeta USER_FORBIDDEN = new ErrorMeta(isvModule, "10016", "用户已禁用");
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user