Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
ad3b77d1
Commit
ad3b77d1
authored
Sep 03, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
ef4f04d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
3 deletions
+21
-3
Menu.java
...n/java/com/github/wxiaoqi/security/admin/entity/Menu.java
+16
-0
UserController.java
...om/github/wxiaoqi/security/admin/rest/UserController.java
+2
-2
PermissionService.java
...wxiaoqi/security/admin/rpc/service/PermissionService.java
+2
-1
MenuMapper.xml
...odules/ace-admin/src/main/resources/mapper/MenuMapper.xml
+1
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/Menu.java
View file @
ad3b77d1
...
...
@@ -25,6 +25,8 @@ public class Menu {
private
String
type
;
private
String
state
;
private
String
description
;
@Column
(
name
=
"crt_time"
)
...
...
@@ -167,6 +169,20 @@ public class Menu {
this
.
type
=
type
;
}
/**
* @return state
*/
public
String
getState
()
{
return
state
;
}
/**
* @param state
*/
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
/**
* @return description
*/
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserController.java
View file @
ad3b77d1
...
...
@@ -120,8 +120,8 @@ public class UserController extends CommonBaseController {
@RequestMapping
(
value
=
"/front/menus"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
MenuTree
>
getMenusByUsername
(
String
token
)
throws
Exception
{
return
permissionService
.
getMenusByUsername
(
token
);
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
return
permissionService
.
getMenusByUsername
(
token
,
state
);
}
@RequestMapping
(
value
=
"/front/menu/all"
,
method
=
RequestMethod
.
GET
)
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/PermissionService.java
View file @
ad3b77d1
...
...
@@ -170,13 +170,14 @@ public class PermissionService {
return
frontUser
;
}
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
)
throws
Exception
{
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
if
(
username
==
null
)
{
return
null
;
}
User
user
=
userBiz
.
getUserByUsername
(
username
);
List
<
Menu
>
menus
=
menuBiz
.
getUserAuthorityMenuByUserId
(
user
.
getId
());
menus
=
menus
.
stream
().
filter
(
a
->
state
.
contains
(
a
.
getState
())).
collect
(
Collectors
.
toList
());
return
getMenuTree
(
menus
,
AdminCommonConstant
.
ROOT
);
}
}
ace-modules/ace-admin/src/main/resources/mapper/MenuMapper.xml
View file @
ad3b77d1
...
...
@@ -12,6 +12,7 @@
<result
column=
"href"
jdbcType=
"VARCHAR"
property=
"href"
/>
<result
column=
"icon"
jdbcType=
"VARCHAR"
property=
"icon"
/>
<result
column=
"type"
jdbcType=
"CHAR"
property=
"type"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
<result
column=
"description"
jdbcType=
"VARCHAR"
property=
"description"
/>
<result
column=
"crt_time"
jdbcType=
"DATE"
property=
"crtTime"
/>
<result
column=
"crt_user"
jdbcType=
"VARCHAR"
property=
"crtUser"
/>
...
...
Write
Preview
Markdown
is supported
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