Commit b25faadd authored by lvweichao's avatar lvweichao

update: router guards

parent 04e74b14
...@@ -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()
} }
......
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,
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment