|
@@ -18,6 +18,7 @@ import com.xy.redis.RedisCache;
|
|
|
import com.xy.service.SysMenuService;
|
|
|
import com.xy.service.SysRoleMenuService;
|
|
|
import com.xy.third.baidu.TransApi;
|
|
|
+import com.xy.utils.AuthorizeUtils;
|
|
|
import com.xy.utils.Emptys;
|
|
|
import com.xy.utils.MybatisPlusQuery;
|
|
|
import com.xy.utils.R;
|
|
@@ -96,6 +97,15 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
List<SysMenuJoinSysRoleMenu> menus = Emptys.check(workMenu.getClientType())
|
|
|
? RedisCache.getMenuTree(workMenu.getSysId(), workMenu.getClientType())
|
|
|
: RedisCache.getMenuTree(workMenu.getSysId());
|
|
|
+// if (CollUtil.isEmpty(menus)) {
|
|
|
+// Long loginId = AuthorizeUtils.getLoginId(Long.class);
|
|
|
+// RedisCache.workCache(loginId);
|
|
|
+// menus = Emptys.check(workMenu.getClientType())
|
|
|
+// ? RedisCache.getMenuTree(workMenu.getSysId(), workMenu.getClientType())
|
|
|
+// : RedisCache.getMenuTree(workMenu.getSysId());
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
menus.forEach(sysMenuJoinSysRoleMenu -> {
|
|
|
SysMenuDto.Vo vo = copy(SysMenuDto.Vo.class, sysMenuJoinSysRoleMenu);
|
|
|
List<SysMenuDto.Vo> sonVos = copy(SysMenuDto.Vo.class, sysMenuJoinSysRoleMenu.getSonSysMenu());
|
|
@@ -109,6 +119,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
public R<List<SysMenuDto.MenuVo>> workMenuList(@RequestHeader(value = "lang", required = false) String lang, @RequestBody @Validated SysMenuDto.WorkMenuList workMenu) {
|
|
|
List<SysMenuDto.MenuVo> menuVos = new ArrayList<>();
|
|
|
List<Long> sysIds = workMenu.getSysId();
|
|
|
+ Long loginId = AuthorizeUtils.getLoginId(Long.class);
|
|
|
List<SysSystem> sysSystems = sysSystemMapper.selectList(new LambdaQueryWrapper<SysSystem>().in(SysSystem::getId, sysIds));
|
|
|
JMap<Long, SysSystem> sysSystemJMap = new JArrayList<>(sysSystems).toMap(SysSystem::getId).cover();
|
|
|
for (Long sysId : sysIds) {
|
|
@@ -116,6 +127,12 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
List<SysMenuJoinSysRoleMenu> menus = Emptys.check(workMenu.getClientType())
|
|
|
? RedisCache.getMenu(sysId, workMenu.getClientType())
|
|
|
: RedisCache.getMenu(sysId);
|
|
|
+// if (CollUtil.isEmpty(menus)) {
|
|
|
+// RedisCache.workCache(loginId);
|
|
|
+// menus = Emptys.check(workMenu.getClientType())
|
|
|
+// ? RedisCache.getMenu(sysId, workMenu.getClientType())
|
|
|
+// : RedisCache.getMenu(sysId);
|
|
|
+// }
|
|
|
menus.forEach(sysMenuJoinSysRoleMenu -> list.add(copy(SysMenuDto.Vo.class, sysMenuJoinSysRoleMenu)));
|
|
|
if ("en".equals(lang)) {
|
|
|
//英文菜单
|