From 0d86ce1e83f2b75ccdee0ccbfd072a7b60c9482f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Mon, 12 Apr 2021 22:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A6=96=E9=A1=B5=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/FunctionController.java | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java index f4f98c4f..f4212ded 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java @@ -36,25 +36,6 @@ public class FunctionController { @Resource private UserBusinessService userBusinessService; - @PostMapping(value = "/findMenu") - public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber, - @RequestParam(value="hasFunction") String hasFunction, - HttpServletRequest request)throws Exception { - //存放数据json数组 - JSONArray dataArray = new JSONArray(); - try { - //当前用户所拥有的功能列表,格式如:[1][2][5] - String fc = hasFunction; - List dataList = functionService.getRoleFunction(pNumber); - if (dataList.size() != 0) { - dataArray = getMenuByFunction(dataList, fc); - } - } catch (DataAccessException e) { - logger.error(">>>>>>>>>>>>>>>>>>>查找异常", e); - } - return dataArray; - } - public JSONArray getMenuByFunction(List dataList, String fc) throws Exception { JSONArray dataArray = new JSONArray(); for (Function function : dataList) { @@ -111,6 +92,14 @@ public class FunctionController { List dataList = functionService.getRoleFunction(pNumber); if (dataList.size() != 0) { dataArray = getMenuByFunction(dataList, fc); + //增加首页菜单项 + JSONObject homeItem = new JSONObject(); + homeItem.put("id", 0); + homeItem.put("text", "首页"); + homeItem.put("icon", "home"); + homeItem.put("url", "/dashboard/analysis"); + homeItem.put("component", "/layouts/TabLayout"); + dataArray.add(0,homeItem); } } catch (DataAccessException e) { logger.error(">>>>>>>>>>>>>>>>>>>查找异常", e);