Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform-ui
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
qa-platform-ui
Commits
127e03dd
Commit
127e03dd
authored
Jul 07, 2021
by
晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改权限登陆问题
parent
0e6583f5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
index.js
src/router/index.js
+9
-8
Aside.vue
src/views/layout/leftAside/Aside.vue
+6
-5
Login.vue
src/views/login/Login.vue
+1
-1
No files found.
src/router/index.js
View file @
127e03dd
...
@@ -212,19 +212,20 @@ const router = new Router({
...
@@ -212,19 +212,20 @@ const router = new Router({
]
]
})
})
// 判断用户是否登陆到系统
// 判断用户是否登陆到系统
router
.
beforeEach
(
function
(
to
,
from
,
next
)
{
router
.
beforeEach
(
function
(
to
,
from
,
next
)
{
var
token
=
window
.
sessionStorage
.
getItem
(
'
token
'
)
var
token
=
window
.
sessionStorage
.
getItem
(
'
token
'
)
if
(
token
!==
null
)
{
if
(
token
!==
null
)
{
if
(
to
.
path
===
'
/login
'
)
{
if
(
to
.
path
===
'
/login
'
)
{
next
(
'
/main
'
)
next
(
'
/main
'
)
}
else
if
(
to
.
path
===
'
/main
'
)
{
next
()
}
else
{
}
else
{
// var menuList = window.sessionStorage.getItem('menuList')
var
menuList
=
window
.
sessionStorage
.
getItem
(
'
menuList
'
)
// if (menuList.indexOf(to.path) > -1) {
if
(
menuList
.
indexOf
(
to
.
path
)
>
-
1
)
{
// next()
// } else {
// next('/main')
// }
next
()
next
()
}
else
{
next
(
'
/main
'
)
}
}
}
}
else
{
}
else
{
if
(
to
.
path
===
'
/login
'
)
{
if
(
to
.
path
===
'
/login
'
)
{
...
...
src/views/layout/leftAside/Aside.vue
View file @
127e03dd
...
@@ -97,7 +97,11 @@ export default {
...
@@ -97,7 +97,11 @@ export default {
// this.$store.dispatch('user/userMsg', {
// this.$store.dispatch('user/userMsg', {
// userInfo: resp.data.data
// userInfo: resp.data.data
// })
// })
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
window
.
sessionStorage
.
clear
()
this
.
$router
.
push
(
'
/login
'
)
}
// 同步赋值mutations
// 同步赋值mutations
this
.
$store
.
commit
(
'
user/SET_USER
'
,
resp
.
data
.
data
)
this
.
$store
.
commit
(
'
user/SET_USER
'
,
resp
.
data
.
data
)
...
@@ -106,10 +110,7 @@ export default {
...
@@ -106,10 +110,7 @@ export default {
'
permissionList
'
,
'
permissionList
'
,
resp
.
data
.
data
.
permissionCodeList
resp
.
data
.
data
.
permissionCodeList
)
)
window
.
sessionStorage
.
setItem
(
window
.
sessionStorage
.
setItem
(
'
menuList
'
,
resp
.
data
.
data
.
menuList
)
'
menuList
'
,
resp
.
data
.
data
.
menuList
)
this
.
menuList
=
resp
.
data
.
data
.
menuList
this
.
menuList
=
resp
.
data
.
data
.
menuList
this
.
getNav
()
this
.
getNav
()
})
})
...
...
src/views/login/Login.vue
View file @
127e03dd
<
template
>
<
template
>
<div
class=
"main"
>
<div
class=
"main"
>
<div
class=
"container"
>
<div
class=
"container"
>
<h3
class=
"title"
>
测试平台
</h3>
<h3
class=
"title"
>
测试平台
</h3>
<el-form
style=
"margin-left:50px"
:model=
"loginForm"
:rules=
"loginRules"
ref=
"loginFormRef"
>
<el-form
style=
"margin-left:50px"
:model=
"loginForm"
:rules=
"loginRules"
ref=
"loginFormRef"
>
<el-form-item
prop=
"username"
class=
"input-style"
>
<el-form-item
prop=
"username"
class=
"input-style"
>
...
...
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