|
@@ -9,6 +9,7 @@ import com.ruoyi.common.log.enums.BusinessType;
|
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
|
|
import com.ruoyi.system.domain.SysMenu;
|
|
|
+import com.ruoyi.system.domain.vo.RouterVo;
|
|
|
import com.ruoyi.system.service.ISysMenuService;
|
|
|
import com.ruoyi.system.validate.group.AddGroup;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -19,7 +20,7 @@ import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 菜单信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
*/
|
|
|
@RestController
|
|
@@ -139,15 +140,29 @@ public class SysMenuController extends BaseController
|
|
|
|
|
|
/**
|
|
|
* 获取路由信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @return 路由信息
|
|
|
*/
|
|
|
@GetMapping("getRouters")
|
|
|
- public AjaxResult getRouters()
|
|
|
+ public AjaxResult getRouters(SysMenu menu)
|
|
|
{
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
|
|
- return AjaxResult.success(menuService.buildMenusBefore(menus));
|
|
|
+ List<RouterVo> res = menuService.buildMenusBefore(menus);
|
|
|
+ if (StringUtils.equals(menu.getMenuName(), "gljt")) {
|
|
|
+ res.forEach(r -> {
|
|
|
+ if (!r.getName().contains("gljt") && !r.getName().contains("Gljt")) {
|
|
|
+ r.setAlwaysShow(false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ res.forEach(r -> {
|
|
|
+ if (r.getName().contains("gljt") || r.getName().contains("Gljt")) {
|
|
|
+ r.setAlwaysShow(false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return AjaxResult.success(res);
|
|
|
}
|
|
|
//
|
|
|
// @GetMapping("/checkMenu/{path}")
|
|
@@ -157,4 +172,4 @@ public class SysMenuController extends BaseController
|
|
|
// List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
|
|
// return AjaxResult.success(menuService.buildMenus(menus));
|
|
|
// }
|
|
|
-}
|
|
|
+}
|