|
@@ -1,5 +1,6 @@
|
|
|
package com.gis.admin.controller;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.gis.admin.entity.po.SysRoleEntity;
|
|
|
import com.gis.common.base.entity.po.LogEntity;
|
|
|
import com.gis.common.base.service.LogService;
|
|
@@ -87,14 +88,15 @@ public class LoginController {
|
|
|
|
|
|
Long userId = entity.getId();
|
|
|
Object role = getRoleKey(userId);
|
|
|
-// SysRoleEntity role = getRole(userId);
|
|
|
log.info("role: {}", role);
|
|
|
-// String roleKey = role.getRoleKey();
|
|
|
|
|
|
- if ("cms".equals(from) && ((Set)role).contains("sys_visitor")) {
|
|
|
- log.error("游客不能登录管理后台");
|
|
|
- return Result.failure("非法用户");
|
|
|
- }
|
|
|
+ if ("cms".equals(from)) {
|
|
|
+ if (((Set)role).contains("sys_visitor") || CollectionUtil.isEmpty((Set)role)){
|
|
|
+ log.error("游客不能登录管理后台");
|
|
|
+ return Result.failure("非法用户");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
// 解密密码
|
|
|
String password = Base64Converter.decodePassword(param.getPassword());
|
|
@@ -189,9 +191,12 @@ public class LoginController {
|
|
|
Object role = getRoleKey(userId);
|
|
|
log.info("role: {}", role);
|
|
|
|
|
|
- if ("cms".equals(from) && ((Set)role).contains("sys_visitor")) {
|
|
|
- log.error("游客不能登录管理后台");
|
|
|
- return Result.failure("非法用户");
|
|
|
+ if ("cms".equals(from)) {
|
|
|
+ if (((Set)role).contains("sys_visitor") || CollectionUtil.isEmpty((Set)role)){
|
|
|
+ log.error("游客不能登录管理后台");
|
|
|
+ return Result.failure("非法用户");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 验证密码,解密出来是明文密码,在跟输入密码比较
|