|
@@ -1,6 +1,8 @@
|
|
|
import Vue from 'vue'
|
|
|
import Router from 'vue-router'
|
|
|
import { getQueryParams } from '@/utils/other'
|
|
|
+// import { name } from '@/store/getters'
|
|
|
+import store from '@/store'
|
|
|
|
|
|
Vue.use(Router)
|
|
|
|
|
@@ -203,16 +205,25 @@ export const constantRoutes = [
|
|
|
children: [
|
|
|
{
|
|
|
path: 'index',
|
|
|
- component: () => import('@/views/index'),
|
|
|
+ component: () => {
|
|
|
+ console.log(store);
|
|
|
+ let isAdmin = store.state.user.name == 'admin';
|
|
|
+ if (isAdmin) {
|
|
|
+ return import('@/views/indexOld')
|
|
|
+ } else {
|
|
|
+ return import('@/views/index')
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
name: 'Index',
|
|
|
meta: { title: '首页', icon: 'dashboard', affix: true }
|
|
|
},
|
|
|
- {
|
|
|
- path: 'indexOld',
|
|
|
- component: () => import('@/views/indexOld'),
|
|
|
- name: 'IndexOld',
|
|
|
- meta: { title: '首页', icon: 'dashboard', affix: true }
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // path: 'indexOld',
|
|
|
+ // component: () => import('@/views/indexOld'),
|
|
|
+ // name: 'IndexOld',
|
|
|
+ // meta: { title: '首页1', icon: 'dashboard', affix: true }
|
|
|
+ // },
|
|
|
{
|
|
|
path: '/asEditor',
|
|
|
component: Layout,
|