|
@@ -89,12 +89,12 @@ public class LoginController {
|
|
|
}
|
|
|
|
|
|
Long userId = entity.getId();
|
|
|
-// Object role = getRole(userId);
|
|
|
- SysRoleEntity role = getRole(userId);
|
|
|
+ Object role = getRoleKey(userId);
|
|
|
+// SysRoleEntity role = getRole(userId);
|
|
|
log.info("role: {}", role);
|
|
|
- String roleKey = role.getRoleKey();
|
|
|
+// String roleKey = role.getRoleKey();
|
|
|
|
|
|
- if ("cms".equals(from) && roleKey.contains("sys_visitor")) {
|
|
|
+ if ("cms".equals(from) && ((Set)role).contains("sys_visitor")) {
|
|
|
log.error("游客不能登录管理后台");
|
|
|
return Result.failure("非法用户");
|
|
|
}
|
|
@@ -116,7 +116,7 @@ public class LoginController {
|
|
|
HashMap<String, Object> tokenMap = new HashMap<>();
|
|
|
tokenMap.put("userName", entity.getUserName());
|
|
|
tokenMap.put("id", userId);
|
|
|
- tokenMap.put("role", getRoleKey(userId));
|
|
|
+ tokenMap.put("role", role);
|
|
|
|
|
|
String token = JwtUtil.createJWT(TOKEN_EXPIRE, tokenMap);
|
|
|
|
|
@@ -125,8 +125,8 @@ public class LoginController {
|
|
|
result.put("user", entity);
|
|
|
result.put("token", token);
|
|
|
// 角色控制系统管理(sys_admin)、内容管理
|
|
|
- result.put("role", roleKey);
|
|
|
- result.put("roleName", role.getRoleName());
|
|
|
+ result.put("role", role);
|
|
|
+// result.put("roleName", role.getRoleName());
|
|
|
|
|
|
|
|
|
// 保存操作日志
|