admin后台登录

This commit is contained in:
tanghc
2019-04-03 10:51:45 +08:00
parent 85e98f1e14
commit a778ffb497
3 changed files with 24 additions and 1 deletions

View File

@@ -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);

View File

@@ -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", "用户已禁用");
}