|
@@ -9,7 +9,9 @@ import com.zhongzheng.common.core.domain.TreeSelect;
|
|
|
import com.zhongzheng.common.core.domain.entity.SysMenu;
|
|
import com.zhongzheng.common.core.domain.entity.SysMenu;
|
|
|
import com.zhongzheng.common.core.domain.entity.SysRole;
|
|
import com.zhongzheng.common.core.domain.entity.SysRole;
|
|
|
import com.zhongzheng.common.core.domain.entity.SysUser;
|
|
import com.zhongzheng.common.core.domain.entity.SysUser;
|
|
|
|
|
+import com.zhongzheng.common.core.domain.model.LoginUser;
|
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
|
|
+import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.system.domain.SysRoleMenu;
|
|
import com.zhongzheng.modules.system.domain.SysRoleMenu;
|
|
|
import com.zhongzheng.modules.system.domain.vo.MetaVo;
|
|
import com.zhongzheng.modules.system.domain.vo.MetaVo;
|
|
|
import com.zhongzheng.modules.system.domain.vo.RouterVo;
|
|
import com.zhongzheng.modules.system.domain.vo.RouterVo;
|
|
@@ -18,6 +20,8 @@ import com.zhongzheng.modules.system.mapper.SysMenuMapper;
|
|
|
import com.zhongzheng.modules.system.mapper.SysRoleMapper;
|
|
import com.zhongzheng.modules.system.mapper.SysRoleMapper;
|
|
|
import com.zhongzheng.modules.system.mapper.SysRoleMenuMapper;
|
|
import com.zhongzheng.modules.system.mapper.SysRoleMenuMapper;
|
|
|
import com.zhongzheng.modules.system.service.ISysUserService;
|
|
import com.zhongzheng.modules.system.service.ISysUserService;
|
|
|
|
|
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
|
|
+import com.zhongzheng.modules.user.vo.UserVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -42,6 +46,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysUserService userService;
|
|
private ISysUserService userService;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据用户查询系统菜单列表
|
|
* 根据用户查询系统菜单列表
|
|
|
*
|
|
*
|
|
@@ -105,7 +111,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
@Override
|
|
@Override
|
|
|
public List<SysMenu> selectMenuTreeByUserId(Long userId) {
|
|
public List<SysMenu> selectMenuTreeByUserId(Long userId) {
|
|
|
List<SysMenu> menus = null;
|
|
List<SysMenu> menus = null;
|
|
|
- if (SecurityUtils.isAdmin(userId)) {
|
|
|
|
|
|
|
+ SysUser user = userService.selectUserById(userId);
|
|
|
|
|
+ if (SecurityUtils.isAdmin(user.getUserName())) {
|
|
|
menus = baseMapper.selectMenuTreeAll();
|
|
menus = baseMapper.selectMenuTreeAll();
|
|
|
} else {
|
|
} else {
|
|
|
menus = baseMapper.selectMenuTreeByUserId(userId);
|
|
menus = baseMapper.selectMenuTreeByUserId(userId);
|