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
JSH ERP
Commits
0d86ce1e
Commit
0d86ce1e
authored
Apr 12, 2021
by
季圣华
Browse files
增加首页路由
parent
86405ba0
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java
View file @
0d86ce1e
...
@@ -36,25 +36,6 @@ public class FunctionController {
...
@@ -36,25 +36,6 @@ public class FunctionController {
@Resource
@Resource
private
UserBusinessService
userBusinessService
;
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
<
Function
>
dataList
=
functionService
.
getRoleFunction
(
pNumber
);
if
(
dataList
.
size
()
!=
0
)
{
dataArray
=
getMenuByFunction
(
dataList
,
fc
);
}
}
catch
(
DataAccessException
e
)
{
logger
.
error
(
">>>>>>>>>>>>>>>>>>>查找异常"
,
e
);
}
return
dataArray
;
}
public
JSONArray
getMenuByFunction
(
List
<
Function
>
dataList
,
String
fc
)
throws
Exception
{
public
JSONArray
getMenuByFunction
(
List
<
Function
>
dataList
,
String
fc
)
throws
Exception
{
JSONArray
dataArray
=
new
JSONArray
();
JSONArray
dataArray
=
new
JSONArray
();
for
(
Function
function
:
dataList
)
{
for
(
Function
function
:
dataList
)
{
...
@@ -111,6 +92,14 @@ public class FunctionController {
...
@@ -111,6 +92,14 @@ public class FunctionController {
List
<
Function
>
dataList
=
functionService
.
getRoleFunction
(
pNumber
);
List
<
Function
>
dataList
=
functionService
.
getRoleFunction
(
pNumber
);
if
(
dataList
.
size
()
!=
0
)
{
if
(
dataList
.
size
()
!=
0
)
{
dataArray
=
getMenuByFunction
(
dataList
,
fc
);
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
)
{
}
catch
(
DataAccessException
e
)
{
logger
.
error
(
">>>>>>>>>>>>>>>>>>>查找异常"
,
e
);
logger
.
error
(
">>>>>>>>>>>>>>>>>>>查找异常"
,
e
);
...
...
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