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
0ccd346f
"vscode:/vscode.git/clone" did not exist on "bcf4b054771d64503da2a9835d4ae30a133ffa0f"
Commit
0ccd346f
authored
Apr 13, 2021
by
季圣华
Browse files
解决超管无法配权限的bug
parent
0d86ce1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java
View file @
0ccd346f
...
@@ -36,36 +36,6 @@ public class FunctionController {
...
@@ -36,36 +36,6 @@ public class FunctionController {
@Resource
@Resource
private
UserBusinessService
userBusinessService
;
private
UserBusinessService
userBusinessService
;
public
JSONArray
getMenuByFunction
(
List
<
Function
>
dataList
,
String
fc
)
throws
Exception
{
JSONArray
dataArray
=
new
JSONArray
();
for
(
Function
function
:
dataList
)
{
JSONObject
item
=
new
JSONObject
();
List
<
Function
>
newList
=
functionService
.
getRoleFunction
(
function
.
getNumber
());
item
.
put
(
"id"
,
function
.
getId
());
item
.
put
(
"text"
,
function
.
getName
());
item
.
put
(
"icon"
,
function
.
getIcon
());
item
.
put
(
"url"
,
function
.
getUrl
());
//if (Tools.isPluginUrl(function.getUrl())) {
// item.put("path", Tools.md5Encryp(function.getUrl()));
//} else {
// item.put("path", function.getUrl());
//}
item
.
put
(
"component"
,
function
.
getComponent
());
if
(
newList
.
size
()>
0
)
{
JSONArray
childrenArr
=
getMenuByFunction
(
newList
,
fc
);
if
(
childrenArr
.
size
()>
0
)
{
item
.
put
(
"children"
,
childrenArr
);
dataArray
.
add
(
item
);
}
}
else
{
if
(
fc
.
indexOf
(
"["
+
function
.
getId
().
toString
()
+
"]"
)
!=
-
1
)
{
dataArray
.
add
(
item
);
}
}
}
return
dataArray
;
}
@PostMapping
(
value
=
"/findMenuByPNumber"
)
@PostMapping
(
value
=
"/findMenuByPNumber"
)
public
JSONArray
findMenuByPNumber
(
@RequestBody
JSONObject
jsonObject
,
public
JSONArray
findMenuByPNumber
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
...
@@ -107,6 +77,36 @@ public class FunctionController {
...
@@ -107,6 +77,36 @@ public class FunctionController {
return
dataArray
;
return
dataArray
;
}
}
public
JSONArray
getMenuByFunction
(
List
<
Function
>
dataList
,
String
fc
)
throws
Exception
{
JSONArray
dataArray
=
new
JSONArray
();
for
(
Function
function
:
dataList
)
{
JSONObject
item
=
new
JSONObject
();
List
<
Function
>
newList
=
functionService
.
getRoleFunction
(
function
.
getNumber
());
item
.
put
(
"id"
,
function
.
getId
());
item
.
put
(
"text"
,
function
.
getName
());
item
.
put
(
"icon"
,
function
.
getIcon
());
item
.
put
(
"url"
,
function
.
getUrl
());
//if (Tools.isPluginUrl(function.getUrl())) {
// item.put("path", Tools.md5Encryp(function.getUrl()));
//} else {
// item.put("path", function.getUrl());
//}
item
.
put
(
"component"
,
function
.
getComponent
());
if
(
newList
.
size
()>
0
)
{
JSONArray
childrenArr
=
getMenuByFunction
(
newList
,
fc
);
if
(
childrenArr
.
size
()>
0
)
{
item
.
put
(
"children"
,
childrenArr
);
dataArray
.
add
(
item
);
}
}
else
{
if
(
fc
.
indexOf
(
"["
+
function
.
getId
().
toString
()
+
"]"
)
!=
-
1
)
{
dataArray
.
add
(
item
);
}
}
}
return
dataArray
;
}
/**
/**
* 角色对应功能显示
* 角色对应功能显示
* @param request
* @param request
...
@@ -120,9 +120,9 @@ public class FunctionController {
...
@@ -120,9 +120,9 @@ public class FunctionController {
List
<
Function
>
dataListFun
=
functionService
.
findRoleFunction
(
"0"
);
List
<
Function
>
dataListFun
=
functionService
.
findRoleFunction
(
"0"
);
//开始拼接json数据
//开始拼接json数据
JSONObject
outer
=
new
JSONObject
();
JSONObject
outer
=
new
JSONObject
();
outer
.
put
(
"id"
,
1
);
outer
.
put
(
"id"
,
0
);
outer
.
put
(
"key"
,
1
);
outer
.
put
(
"key"
,
0
);
outer
.
put
(
"value"
,
1
);
outer
.
put
(
"value"
,
0
);
outer
.
put
(
"title"
,
"功能列表"
);
outer
.
put
(
"title"
,
"功能列表"
);
outer
.
put
(
"attributes"
,
"功能列表"
);
outer
.
put
(
"attributes"
,
"功能列表"
);
//存放数据json数组
//存放数据json数组
...
...
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