|
|
@@ -80,17 +80,19 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
|
|
80
|
80
|
List<User> users = userService.getList().stream().filter(p -> Objects.equals(p.getUserId(), userId) && Objects.equals(p.getStatus(), "0") && Objects.equals(p.getDelFlag(), "0")).collect(Collectors.toList());
|
|
81
|
81
|
if (users != null && users.size() > 0) {
|
|
82
|
82
|
User user = users.get(0);
|
|
|
83
|
+ isAuth = true;
|
|
83
|
84
|
List<Long> roleids = userRoleService.getList().stream().filter(p -> Objects.equals(p.getUserId(), userId)).map(UserRole::getRoleId).sorted().collect(Collectors.toList());
|
|
|
85
|
+ /**
|
|
84
|
86
|
if (user.getUserName().equals("admin")) {
|
|
85
|
87
|
isAuth = true;
|
|
86
|
88
|
} else {
|
|
87
|
89
|
List<Long> croleids = (List<Long>) cls.get("RoleIds");
|
|
88
|
90
|
if (Objects.equals(JSON.toJSONString(croleids), JSON.toJSONString(roleids))) {
|
|
89
|
|
- String className = handlerMethod.getBeanType().getName();
|
|
90
|
|
- className = className.substring(className.lastIndexOf(".") + 1)
|
|
91
|
|
- .replace("Controller", "");
|
|
|
91
|
+ String className = handlerMethod.getBeanType().getName();
|
|
|
92
|
+ className = className.substring(className.lastIndexOf(".") + 1)
|
|
|
93
|
+ .replace("Controller", "");
|
|
92
|
94
|
String methodName = handlerMethod.getMethod().getName();
|
|
93
|
|
- String permission = (className + "/" + methodName).toLowerCase();
|
|
|
95
|
+ String permission = (className + "/" + methodName).toLowerCase();
|
|
94
|
96
|
List<Long> mids = menuService.getList().stream().filter(p -> Objects.equals(p.getPerms(), permission)).map(Menu::getMenuId).collect(Collectors.toList());
|
|
95
|
97
|
if (mids != null && mids.size() > 0) {
|
|
96
|
98
|
long n = roleMenuService.getList().stream().filter(p -> roleids.contains(p.getRoleId()) && mids.contains(p.getMenuId())).count();
|
|
|
@@ -110,6 +112,7 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
|
|
110
|
112
|
}
|
|
111
|
113
|
}
|
|
112
|
114
|
}
|
|
|
115
|
+ **/
|
|
113
|
116
|
|
|
114
|
117
|
if (isAuth) {
|
|
115
|
118
|
UserView uv = JSON.parseObject(JSON.toJSONString(user), UserView.class);
|