Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
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
tianzhuanghu
ant-design-pro-vue
Commits
69cef260
Commit
69cef260
authored
Sep 25, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add demo permission
parent
1415b75d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
4 deletions
+5
-4
LayoutMain.vue
src/components/layout/LayoutMain.vue
+2
-1
index.js
src/router/index.js
+0
-0
permission.js
src/store/modules/permission.js
+1
-1
user.js
src/store/modules/user.js
+2
-2
No files found.
src/components/layout/LayoutMain.vue
View file @
69cef260
...
@@ -66,10 +66,11 @@
...
@@ -66,10 +66,11 @@
}
}
},
},
created
()
{
created
()
{
this
.
menus
=
asyncRouterMap
this
.
menus
=
this
.
mainMenu
},
},
computed
:
{
computed
:
{
...
mapState
({
...
mapState
({
mainMenu
:
state
=>
state
.
permission
.
addRouters
,
siderOpen
:
state
=>
state
.
app
.
sidebar
.
opened
,
siderOpen
:
state
=>
state
.
app
.
sidebar
.
opened
,
theme
:
state
=>
state
.
app
.
theme
,
theme
:
state
=>
state
.
app
.
theme
,
device
:
state
=>
state
.
app
.
device
,
device
:
state
=>
state
.
app
.
device
,
...
...
src/router/index.js
View file @
69cef260
This diff is collapsed.
Click to expand it.
src/store/modules/permission.js
View file @
69cef260
...
@@ -17,7 +17,7 @@ function hasPermission(permission, route) {
...
@@ -17,7 +17,7 @@ function hasPermission(permission, route) {
}
}
}
}
}
}
return
tru
e
return
fals
e
}
}
/**
/**
...
...
src/store/modules/user.js
View file @
69cef260
...
@@ -52,9 +52,9 @@ const user = {
...
@@ -52,9 +52,9 @@ const user = {
getInfo
().
then
(
response
=>
{
getInfo
().
then
(
response
=>
{
const
result
=
response
.
result
const
result
=
response
.
result
if
(
result
.
role
&&
result
.
permissions
.
length
>
0
)
{
if
(
result
.
role
&&
result
.
role
.
permissions
.
length
>
0
)
{
const
role
=
result
.
role
const
role
=
result
.
role
role
.
permissions
=
result
.
permissions
role
.
permissions
=
result
.
role
.
permissions
role
.
permissions
.
map
(
per
=>
{
role
.
permissions
.
map
(
per
=>
{
if
(
per
.
actionEntitySet
!=
null
&&
per
.
actionEntitySet
.
length
>
0
)
{
if
(
per
.
actionEntitySet
!=
null
&&
per
.
actionEntitySet
.
length
>
0
)
{
let
action
=
per
.
actionEntitySet
.
map
(
action
=>
{
return
action
.
action
})
let
action
=
per
.
actionEntitySet
.
map
(
action
=>
{
return
action
.
action
})
...
...
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