|
@@ -1,7 +1,9 @@
|
|
|
import Vue from 'vue'
|
|
|
import store from '@/store'
|
|
|
import VueRouter from 'vue-router'
|
|
|
-import { query } from '@/utils/query'
|
|
|
+import {
|
|
|
+ query
|
|
|
+} from '@/utils/query'
|
|
|
|
|
|
Vue.use(VueRouter)
|
|
|
const routes = [
|
|
@@ -24,8 +26,7 @@ const routes = [
|
|
|
name: 'home',
|
|
|
component: () => import('../views/index'),
|
|
|
redirect: '/home/homepage',
|
|
|
- children: [
|
|
|
- {
|
|
|
+ children: [{
|
|
|
path: 'homepage',
|
|
|
component: () => import('../views/homepage'),
|
|
|
},
|
|
@@ -73,7 +74,7 @@ const router = new VueRouter({
|
|
|
routes,
|
|
|
})
|
|
|
//不需要token的路由
|
|
|
-const ignore = ['/404', '/legendLibrary', '/legendRules']
|
|
|
+const ignore = ['/404']
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
if (!ignore.includes(to.path)) {
|
|
|
console.log('vuex', store.state.accessLevel)
|
|
@@ -114,4 +115,4 @@ router.beforeEach(async (to, from, next) => {
|
|
|
return
|
|
|
}
|
|
|
})
|
|
|
-export default router
|
|
|
+export default router
|