Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
ca435269
Commit
ca435269
authored
Jun 06, 2020
by
ZhengJie
Browse files
[代码完善](v2.5): v2.5 beta 修复角色修改菜单缓存问题
close #389
parent
00f7939d
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
ca435269
...
@@ -106,20 +106,6 @@
...
@@ -106,20 +106,6 @@
</tr>
</tr>
</table>
</table>
#### 特别鸣谢
-
感谢
[
JetBrains
](
https://www.jetbrains.com/
)
提供的非商业开源软件开发授权
-
感谢
[
PanJiaChen
](
https://github.com/PanJiaChen/vue-element-admin
)
大佬提供的前端模板
-
感谢
[
Moxun
](
https://github.com/moxun1639
)
大佬提供的前端 Curd 通用组件
-
感谢
[
zhy6599
](
https://gitee.com/zhy6599
)
大佬提供的后端运维管理相关功能
-
感谢
[
j.yao.SUSE
](
https://github.com/everhopingandwaiting
)
大佬提供的匿名接口与Redis限流等功能
-
感谢
[
d15801543974
](
https://github.com/d15801543974
)
大佬提供的基于注解的通用查询方式
#### 项目捐赠
#### 项目捐赠
项目的发展离不开你的支持,请作者喝杯咖啡吧☕
[
Donate
](
https://el-admin.vip/donation/
)
项目的发展离不开你的支持,请作者喝杯咖啡吧☕
[
Donate
](
https://el-admin.vip/donation/
)
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java
View file @
ca435269
...
@@ -119,13 +119,13 @@ public class RoleServiceImpl implements RoleService {
...
@@ -119,13 +119,13 @@ public class RoleServiceImpl implements RoleService {
@Override
@Override
public
void
updateMenu
(
Role
resources
,
RoleDto
roleDTO
)
{
public
void
updateMenu
(
Role
resources
,
RoleDto
roleDTO
)
{
Role
role
=
roleMapper
.
toEntity
(
roleDTO
);
Role
role
=
roleMapper
.
toEntity
(
roleDTO
);
// 清理缓存
List
<
User
>
users
=
userRepository
.
findByRoleId
(
role
.
getId
());
List
<
User
>
users
=
userRepository
.
findByRoleId
(
role
.
getId
());
Set
<
Long
>
userIds
=
users
.
stream
().
map
(
User:
:
getId
).
collect
(
Collectors
.
toSet
());
Set
<
Long
>
userIds
=
users
.
stream
().
map
(
User:
:
getId
).
collect
(
Collectors
.
toSet
());
redisUtils
.
delByKeys
(
"menu::user:"
,
userIds
);
redisUtils
.
del
(
"role::id:"
+
resources
.
getId
());
// 更新菜单
// 更新菜单
role
.
setMenus
(
resources
.
getMenus
());
role
.
setMenus
(
resources
.
getMenus
());
// 清理缓存
redisUtils
.
delByKeys
(
"menu::user:"
,
userIds
);
redisUtils
.
del
(
"role::id:"
+
resources
.
getId
());
roleRepository
.
save
(
role
);
roleRepository
.
save
(
role
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment