Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
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
bp
op-web-service
Commits
b25faadd
Commit
b25faadd
authored
Jun 01, 2021
by
lvweichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: router guards
parent
04e74b14
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
main.js
src/main.js
+2
-0
index.js
src/router/index.js
+7
-3
No files found.
src/main.js
View file @
b25faadd
...
@@ -23,9 +23,11 @@ router.beforeResolve(async (to, from, next) => {
...
@@ -23,9 +23,11 @@ router.beforeResolve(async (to, from, next) => {
router
.
push
(
'/403'
)
router
.
push
(
'/403'
)
}
}
})
})
next
()
}
else
{
}
else
{
redirectToLogin
();
redirectToLogin
();
}
}
return
false
;
}
else
{
}
else
{
next
()
next
()
}
}
...
...
src/router/index.js
View file @
b25faadd
import
{
createRouter
,
createWebHistory
}
from
"vue-router"
;
import
{
createRouter
,
createWebHistory
}
from
"vue-router"
;
import
Certification
from
'@/pages/Enterprise/Certification'
import
Audit
from
'@/pages/Enterprise/Audit'
import
Establish
from
'@/pages/Enterprise/Establish'
import
LifeNo
from
'../pages/Life-no/index.vue'
import
LifeNo
from
'../pages/Life-no/index.vue'
import
LifeNoDetail
from
'../pages/Life-no/life-no-detail.vue'
import
LifeNoDetail
from
'../pages/Life-no/life-no-detail.vue'
...
@@ -26,7 +30,7 @@ const routes = [
...
@@ -26,7 +30,7 @@ const routes = [
{
{
path
:
'/enterprise/certification'
,
path
:
'/enterprise/certification'
,
name
:
'Certification'
,
name
:
'Certification'
,
component
:
()
=>
import
(
/* webpackChunkName: "enterprise" */
'@/pages/Enterprise/Certification'
)
,
component
:
Certification
,
meta
:
{
meta
:
{
requireAuth
:
true
,
requireAuth
:
true
,
},
},
...
@@ -34,7 +38,7 @@ const routes = [
...
@@ -34,7 +38,7 @@ const routes = [
{
{
path
:
'/enterprise/audit'
,
path
:
'/enterprise/audit'
,
name
:
'Audit'
,
name
:
'Audit'
,
component
:
()
=>
import
(
/* webpackChunkName: "enterprise" */
'@/pages/Enterprise/Audit'
)
,
component
:
Audit
,
meta
:
{
meta
:
{
requireAuth
:
true
,
requireAuth
:
true
,
}
}
...
@@ -42,7 +46,7 @@ const routes = [
...
@@ -42,7 +46,7 @@ const routes = [
{
{
path
:
'/enterprise/establish'
,
path
:
'/enterprise/establish'
,
name
:
'Establish'
,
name
:
'Establish'
,
component
:
()
=>
import
(
/* webpackChunkName: "enterprise" */
'@/pages/Enterprise/Establish'
)
,
component
:
Establish
,
meta
:
{
meta
:
{
requireAuth
:
true
,
requireAuth
:
true
,
}
}
...
...
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