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
867ac68b
Commit
867ac68b
authored
Jul 06, 2021
by
晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改路由跳转问题
parent
fde01b8d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
21 deletions
+43
-21
package-lock.json
package-lock.json
+5
-0
package.json
package.json
+1
-0
index.js
src/router/index.js
+24
-16
Aside.vue
src/views/layout/leftAside/Aside.vue
+4
-0
Header.vue
src/views/layout/rightMain/Header.vue
+2
-1
Login.vue
src/views/login/Login.vue
+7
-3
role.vue
src/views/user/role.vue
+0
-1
No files found.
package-lock.json
View file @
867ac68b
...
...
@@ -9448,6 +9448,11 @@
"path-key"
:
"^2.0.0"
}
},
"nprogress"
:
{
"version"
:
"0.2.0"
,
"resolved"
:
"https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz"
,
"integrity"
:
"sha1-y480xTIT2JVyP8urkH6UIq28r7E="
},
"nth-check"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz"
,
...
...
package.json
View file @
867ac68b
...
...
@@ -18,6 +18,7 @@
"
echarts
"
:
"
^4.9.0
"
,
"
element-ui
"
:
"
^2.13.2
"
,
"
less
"
:
"
^3.11.1
"
,
"
nprogress
"
:
"
^0.2.0
"
,
"
save
"
:
"
^2.4.0
"
,
"
sortablejs
"
:
"
^1.13.0
"
,
"
vue
"
:
"
^2.5.2
"
,
...
...
src/router/index.js
View file @
867ac68b
import
Vue
from
'
vue
'
// import store from '../store/store'
import
Router
from
'
vue-router
'
import
Login
from
'
../views/login/Login
'
import
Main
from
'
../views/Main
'
...
...
@@ -211,20 +212,27 @@ const router = new Router({
]
})
// 判断用户是否登陆到系统
// router.beforeEach(function(to, from, next) {
// var token = window.sessionStorage.getItem('token')
// if (token) {
// if (to.path === '/login') {
// // 如果已经登陆,跳转到首页
// console.log('777', to.path)
// next()
// } else {
// console.log('888', to.path)
// // 如果没有登录,就跳转登录页面
// store.commit('user/RESET_USER')
// next()
// }
// }
// })
router
.
beforeEach
(
function
(
to
,
from
,
next
)
{
var
token
=
window
.
sessionStorage
.
getItem
(
'
token
'
)
if
(
token
!==
null
)
{
if
(
to
.
path
===
'
/login
'
)
{
next
(
'
/main
'
)
}
else
if
(
to
.
path
===
'
/main
'
)
{
next
()
}
else
{
var
menuList
=
window
.
sessionStorage
.
getItem
(
'
menuList
'
)
if
(
menuList
.
indexOf
(
to
.
path
)
>
-
1
)
{
next
()
}
else
{
next
(
'
/main
'
)
}
}
}
else
{
if
(
to
.
path
===
'
/login
'
)
{
next
()
}
else
{
next
(
'
/login
'
)
}
}
})
export
default
router
src/views/layout/leftAside/Aside.vue
View file @
867ac68b
...
...
@@ -106,6 +106,10 @@ export default {
'
permissionList
'
,
resp
.
data
.
data
.
permissionCodeList
)
window
.
sessionStorage
.
setItem
(
'
menuList
'
,
resp
.
data
.
data
.
menuList
)
this
.
menuList
=
resp
.
data
.
data
.
menuList
this
.
getNav
()
})
...
...
src/views/layout/rightMain/Header.vue
View file @
867ac68b
...
...
@@ -75,6 +75,7 @@ export default {
logout
()
.
then
((
resp
)
=>
{
this
.
$store
.
commit
(
'
user/RESET_USER
'
)
window
.
sessionStorage
.
clear
()
this
.
$router
.
push
(
'
/
'
)
})
.
catch
((
error
)
=>
{
...
...
@@ -148,7 +149,7 @@ p[multiBtn] {
}
.el-dropdown-link {
cursor: pointer;
color:#606266;
color:
#606266;
font-size: 16px;
}
.el-icon-arrow-down {
...
...
src/views/login/Login.vue
View file @
867ac68b
...
...
@@ -58,9 +58,13 @@ export default {
// 调取登陆接口
login
(
this
.
loginForm
)
.
then
((
resp
)
=>
{
// 将token放到Application中
window
.
sessionStorage
.
setItem
(
'
token
'
,
resp
.
data
.
data
.
token
)
this
.
$router
.
push
(
'
/main
'
)
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
'
用户名或密码错误,请重新登陆!
'
)
}
else
{
// 将token放到Application中
window
.
sessionStorage
.
setItem
(
'
token
'
,
resp
.
data
.
data
.
token
)
this
.
$router
.
push
(
'
/main
'
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
...
...
src/views/user/role.vue
View file @
867ac68b
...
...
@@ -121,7 +121,6 @@ export default {
// 获取权限列表
getPermissionList
()
{
getPermissionList
().
then
((
resp
)
=>
{
// console.log('9090', resp.data.data)
this
.
allPermissionList
=
resp
.
data
.
data
})
},
...
...
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