Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qahome-diamond
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qahome-diamond
Commits
5bb6b680
Commit
5bb6b680
authored
Apr 28, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限控制
parent
eed6e017
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
docker.js
src/router/modules/docker.js
+1
-1
user.js
src/store/modules/user.js
+2
-1
createEnv.vue
src/views/docker/createEnv.vue
+3
-2
envTemplate.vue
src/views/docker/envTemplate.vue
+3
-1
No files found.
src/router/modules/docker.js
View file @
5bb6b680
...
@@ -27,7 +27,7 @@ const dockersRouter = {
...
@@ -27,7 +27,7 @@ const dockersRouter = {
path
:
'
createEnv
'
,
path
:
'
createEnv
'
,
component
:
()
=>
import
(
'
@/views/docker/createEnv
'
),
component
:
()
=>
import
(
'
@/views/docker/createEnv
'
),
name
:
'
CreateEnv
'
,
name
:
'
CreateEnv
'
,
meta
:
{
title
:
'
createEnv
'
,
noCache
:
true
}
meta
:
{
title
:
'
createEnv
'
,
noCache
:
true
,
roles
:
[
'
admin
'
]
}
},
},
{
{
path
:
'
envTemplate
'
,
path
:
'
envTemplate
'
,
...
...
src/store/modules/user.js
View file @
5bb6b680
...
@@ -67,7 +67,8 @@ const user = {
...
@@ -67,7 +67,8 @@ const user = {
// reject('Verification failed, please login again.')
// reject('Verification failed, please login again.')
// }
// }
const
data
=
response
.
data
const
data
=
response
.
data
data
.
roles
=
[
'
admin
'
]
// data.roles = ['admin']
data
.
roles
=
data
.
role
if
(
data
.
roles
&&
data
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
if
(
data
.
roles
&&
data
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
commit
(
'
SET_ROLES
'
,
data
.
roles
)
commit
(
'
SET_ROLES
'
,
data
.
roles
)
...
...
src/views/docker/createEnv.vue
View file @
5bb6b680
...
@@ -23,15 +23,16 @@
...
@@ -23,15 +23,16 @@
</el-card>
</el-card>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-button
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
<el-button
v-permission=
"['admin']"
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getAllRepos
,
getAllEnvTemplate
,
createEnv
}
from
'
@/api/docker
'
import
{
getAllRepos
,
getAllEnvTemplate
,
createEnv
}
from
'
@/api/docker
'
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
export
default
{
export
default
{
directives
:
{
permission
},
filters
:
{
filters
:
{
upper
:
function
(
value
)
{
upper
:
function
(
value
)
{
if
(
!
value
)
return
''
if
(
!
value
)
return
''
...
...
src/views/docker/envTemplate.vue
View file @
5bb6b680
...
@@ -22,14 +22,16 @@
...
@@ -22,14 +22,16 @@
</el-card>
</el-card>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-button
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
<el-button
v-permission=
"['admin']"
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getAllRepos
,
getAllEnvTemplate
,
createEnvTemplate
}
from
'
@/api/docker
'
import
{
getAllRepos
,
getAllEnvTemplate
,
createEnvTemplate
}
from
'
@/api/docker
'
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
export
default
{
export
default
{
directives
:
{
permission
},
filters
:
{
filters
:
{
upper
:
function
(
value
)
{
upper
:
function
(
value
)
{
...
...
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