|
@@ -2,6 +2,9 @@ import Vue from 'vue'
|
|
import VueRouter from 'vue-router'
|
|
import VueRouter from 'vue-router'
|
|
import Store from '../store'
|
|
import Store from '../store'
|
|
import Cookies from 'js-cookie'
|
|
import Cookies from 'js-cookie'
|
|
|
|
+
|
|
|
|
+import {stringifyQuery,parseQuery} from '@/utils/query'
|
|
|
|
+
|
|
Vue.use(VueRouter)
|
|
Vue.use(VueRouter)
|
|
|
|
|
|
const originalPush = VueRouter.prototype.push
|
|
const originalPush = VueRouter.prototype.push
|
|
@@ -57,73 +60,129 @@ export const backStageManageRouterItem = [
|
|
},
|
|
},
|
|
]
|
|
]
|
|
},
|
|
},
|
|
-
|
|
|
|
{
|
|
{
|
|
path: '/administrator',
|
|
path: '/administrator',
|
|
- name: 'Administrator_application',
|
|
|
|
|
|
+ name: 'Administrator_organization',
|
|
component: administrator_layout,
|
|
component: administrator_layout,
|
|
- redirect: '/administrator/apply',
|
|
|
|
- meta: { title: '应用管理', icon: 'application' },
|
|
|
|
|
|
+ redirect: '/administrator/personnel',
|
|
|
|
+ meta: { title: '人员组织管理', icon: '人员组织' },
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'addApply',
|
|
|
|
- name: 'Administrator_addApply',
|
|
|
|
- component: () => import('@/views/backStageManage/application/apply/components/addApply.vue'),
|
|
|
|
- meta: {title: '添加应用功能', icon: 'apply', keepAlive:true},
|
|
|
|
- hidden:true
|
|
|
|
|
|
+ path: 'tenant',
|
|
|
|
+ name: 'Administrator_tenant',
|
|
|
|
+ component: () => import('@/views/backStageManage/organization/tenant/index.vue'),
|
|
|
|
+ meta: {title: '企业管理',icon: '企业'},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: 'apply',
|
|
|
|
- name: 'Administrator_apply',
|
|
|
|
- component: () => import('@/views/backStageManage/application/apply/index.vue'),
|
|
|
|
- meta: { title: '应用功能清单', icon: 'apply' }
|
|
|
|
|
|
+ path: 'personnel',
|
|
|
|
+ name: 'Administrator_personnel',
|
|
|
|
+ component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
|
|
|
|
+ meta: {title: '人员清单',icon: '人员'},
|
|
},
|
|
},
|
|
|
|
+ // {
|
|
|
|
+ // path: 'personnel',
|
|
|
|
+ // name: 'Administrator_personnel',
|
|
|
|
+ // component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
|
|
|
|
+ // meta: {title: '部门管理',icon: '部门'},
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // path: 'personnel',
|
|
|
|
+ // name: 'Administrator_personnel',
|
|
|
|
+ // component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
|
|
|
|
+ // meta: {title: '职位管理',icon: '职位'},
|
|
|
|
+ // },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ path: '/administrator',
|
|
|
|
+ name: 'Administrator_application',
|
|
|
|
+ component: administrator_layout,
|
|
|
|
+ redirect: '/administrator/vision',
|
|
|
|
+ meta: { title: '应用管理', icon: 'application' },
|
|
|
|
+ children: [
|
|
|
|
+ // {
|
|
|
|
+ // path: 'addApply',
|
|
|
|
+ // name: 'Administrator_addApply',
|
|
|
|
+ // component: () => import('@/views/backStageManage/application/apply/components/addApply.vue'),
|
|
|
|
+ // meta: {title: '添加应用功能', icon: 'apply', keepAlive:true},
|
|
|
|
+ // hidden:true
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // path: 'apply',
|
|
|
|
+ // name: 'Administrator_apply',
|
|
|
|
+ // component: () => import('@/views/backStageManage/application/apply/index.vue'),
|
|
|
|
+ // meta: { title: '应用功能清单', icon: 'apply' }
|
|
|
|
+ // },
|
|
{
|
|
{
|
|
path: 'vision',
|
|
path: 'vision',
|
|
name: 'Administrator_vision',
|
|
name: 'Administrator_vision',
|
|
component: () => import('@/views/backStageManage/application/vision/index.vue'),
|
|
component: () => import('@/views/backStageManage/application/vision/index.vue'),
|
|
- meta: { title: '应用版本清单', icon: 'vision' }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- path: 'function',
|
|
|
|
- name: 'Administrator_function',
|
|
|
|
- component: () => import('@/views/backStageManage/application/apply/index.vue'),
|
|
|
|
- meta: { title: '功能清单', icon: 'function' }
|
|
|
|
|
|
+ meta: { title: '应用版本管理', icon: '版本' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
path: 'addVersion',
|
|
path: 'addVersion',
|
|
name: 'Administrator_addVersion',
|
|
name: 'Administrator_addVersion',
|
|
component: () => import('@/views/backStageManage/application/vision/addVersion.vue'),
|
|
component: () => import('@/views/backStageManage/application/vision/addVersion.vue'),
|
|
- meta: {title: '添加应用版本', icon: 'addVision'},
|
|
|
|
|
|
+ meta: {title: '添加应用版本', icon: 'addVision',keepAlive:true},
|
|
hidden:true
|
|
hidden:true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
path: 'editVersion',
|
|
path: 'editVersion',
|
|
name: 'Administrator_editVersion',
|
|
name: 'Administrator_editVersion',
|
|
component: () => import('@/views/backStageManage/application/vision/editVersion.vue'),
|
|
component: () => import('@/views/backStageManage/application/vision/editVersion.vue'),
|
|
- meta: {title: '编辑应用版本', icon: 'editVision'},
|
|
|
|
|
|
+ meta: {title: '编辑应用版本', icon: 'editVision',keepAlive:true},
|
|
|
|
+ hidden:true
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ path: 'versionDetail',
|
|
|
|
+ name: 'Administrator_versionDetail',
|
|
|
|
+ component: () => import('@/views/backStageManage/application/vision/versionDetail.vue'),
|
|
|
|
+ meta: {title: '应用版本详情', icon: 'editVision'},
|
|
hidden:true
|
|
hidden:true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: 'vip',
|
|
|
|
- name: 'Administrator_vip',
|
|
|
|
- component: () => import('@/views/backStageManage/application/vip/index.vue'),
|
|
|
|
- meta: {title: '应用会员清单', icon: 'vip'}
|
|
|
|
|
|
+ path: 'vipType',
|
|
|
|
+ name: 'Administrator_vipType',
|
|
|
|
+ component: () => import('@/views/backStageManage/application/vipType/index.vue'),
|
|
|
|
+ meta: {title: '应用会员类型', icon: '会员类型'}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: 'addVip',
|
|
|
|
- name: 'Administrator_addVip',
|
|
|
|
- component: () => import('@/views/backStageManage/application/vip/components/addVipForm.vue'),
|
|
|
|
- meta: {title: '添加应用会员', icon: 'addVip'},
|
|
|
|
|
|
+ path: 'addVipType',
|
|
|
|
+ name: 'Administrator_addVipType',
|
|
|
|
+ component: () => import('@/views/backStageManage/application/vipType/addVipType.vue'),
|
|
|
|
+ meta: {title: '添加应用会员类型',keepAlive:true},
|
|
hidden:true
|
|
hidden:true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: 'editVip',
|
|
|
|
- name: 'Administrator_editVip',
|
|
|
|
- component: () => import('@/views/backStageManage/application/vip/components/editVipForm.vue'),
|
|
|
|
- meta: {title: '编辑应用会员', icon: 'editVip'},
|
|
|
|
|
|
+ path: 'editVipType',
|
|
|
|
+ name: 'Administrator_editVipType',
|
|
|
|
+ component: () => import('@/views/backStageManage/application/vipType/editVipType.vue'),
|
|
|
|
+ meta: {title: '编辑应用会员类型', keepAlive:true},
|
|
hidden:true
|
|
hidden:true
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ path: 'vipTypeDetail',
|
|
|
|
+ name: 'Administrator_vipTypeDetail',
|
|
|
|
+ component: () => import('@/views/backStageManage/application/vipType/vipTypeDetail.vue'),
|
|
|
|
+ meta: {title: '应用会员类型详情'},
|
|
|
|
+ hidden:true
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ path: '/administrator',
|
|
|
|
+ name: 'Administrator_examine',
|
|
|
|
+ component: administrator_layout,
|
|
|
|
+ redirect: '/administrator/examine',
|
|
|
|
+ meta: { title: '审核管理', icon: '审核'},
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ path: 'examine',
|
|
|
|
+ name: 'Administrator_examine',
|
|
|
|
+ component: () => import('@/views/backStageManage/examine/examine/index.vue'),
|
|
|
|
+ meta: {title: '账号审核', icon: '审核'},
|
|
|
|
+ },
|
|
]
|
|
]
|
|
},
|
|
},
|
|
]
|
|
]
|
|
@@ -158,20 +217,22 @@ export const backStageManage = [
|
|
const router = new VueRouter({
|
|
const router = new VueRouter({
|
|
mode: 'history',
|
|
mode: 'history',
|
|
base: '/',
|
|
base: '/',
|
|
- routes: process.env.NODE_ENV !== 'production' ? [...routes, ...backStageManage] : routes
|
|
|
|
|
|
+ stringifyQuery: stringifyQuery, // 序列化query参数
|
|
|
|
+ parseQuery: parseQuery, // 反序列化query参数
|
|
|
|
+ routes: [...routes, ...backStageManage]
|
|
})
|
|
})
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
router.beforeEach((to, from, next) => {
|
|
- const tokenStr = Cookies.get('token')
|
|
|
|
if (to.meta.title) {
|
|
if (to.meta.title) {
|
|
document.title = to.meta.title;
|
|
document.title = to.meta.title;
|
|
}
|
|
}
|
|
- if (to.path == '/administrator/login'||to.path=='/home') {
|
|
|
|
|
|
+ if (to.path == '/administrator/login'|| routeExists(routes,to.path) || to.meta.notLogin) {
|
|
Cookies.remove("token")
|
|
Cookies.remove("token")
|
|
localStorage.removeItem('vuex')
|
|
localStorage.removeItem('vuex')
|
|
next()
|
|
next()
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
|
|
+ const tokenStr = Cookies.get('token')
|
|
switch (tokenStr) {
|
|
switch (tokenStr) {
|
|
case undefined:
|
|
case undefined:
|
|
if (to.meta.title) {
|
|
if (to.meta.title) {
|