功能变化: 兼容乾坤前端微服务
parent
f9130a15df
commit
5b7fd4888e
|
@ -36,6 +36,7 @@
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"lowdb": "^1.0.0",
|
"lowdb": "^1.0.0",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
|
"qiankun": "^2.7.2",
|
||||||
"screenfull": "^5.0.2",
|
"screenfull": "^5.0.2",
|
||||||
"sortablejs": "^1.10.1",
|
"sortablejs": "^1.10.1",
|
||||||
"ua-parser-js": "^0.7.20",
|
"ua-parser-js": "^0.7.20",
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<router-view />
|
<router-view />
|
||||||
|
<!-- 用来兼容乾坤前端微服务 -->
|
||||||
|
<div id="qiankun"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,15 @@ router.beforeEach(async (to, from, next) => {
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
|
const childrenPath = window.qiankunActiveRule || []
|
||||||
|
if (to.name) {
|
||||||
|
// 有 name 属性,说明是主应用的路由
|
||||||
|
next()
|
||||||
|
} else if (childrenPath.some((item) => to.path.includes(item))) {
|
||||||
|
next()
|
||||||
|
} else {
|
||||||
|
next({ name: '404' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 没有登录的时候跳转到登录界面
|
// 没有登录的时候跳转到登录界面
|
||||||
|
|
|
@ -29,34 +29,6 @@ const frameIn = [{
|
||||||
},
|
},
|
||||||
component: () => import('@/layout/header-aside/components/header-user/userinfo')
|
component: () => import('@/layout/header-aside/components/header-user/userinfo')
|
||||||
},
|
},
|
||||||
// 演示页面
|
|
||||||
{
|
|
||||||
path: 'page1',
|
|
||||||
name: 'page1',
|
|
||||||
meta: {
|
|
||||||
title: '页面 1',
|
|
||||||
auth: true
|
|
||||||
},
|
|
||||||
component: _import('demo/page1')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'page2',
|
|
||||||
name: 'page2',
|
|
||||||
meta: {
|
|
||||||
title: '页面 2',
|
|
||||||
auth: true
|
|
||||||
},
|
|
||||||
component: _import('demo/page2')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'page3',
|
|
||||||
name: 'page3',
|
|
||||||
meta: {
|
|
||||||
title: '页面 3',
|
|
||||||
auth: true
|
|
||||||
},
|
|
||||||
component: _import('demo/page3')
|
|
||||||
},
|
|
||||||
// dashboard 工作台
|
// dashboard 工作台
|
||||||
{
|
{
|
||||||
path: 'workbench',
|
path: 'workbench',
|
||||||
|
@ -67,97 +39,6 @@ const frameIn = [{
|
||||||
},
|
},
|
||||||
component: _import('dashboard/workbench')
|
component: _import('dashboard/workbench')
|
||||||
},
|
},
|
||||||
// // 系统 菜单
|
|
||||||
// {
|
|
||||||
// path: 'menu',
|
|
||||||
// name: 'menu',
|
|
||||||
// meta: {
|
|
||||||
// title: '菜单',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/menu')
|
|
||||||
// },
|
|
||||||
// // 系统 用户
|
|
||||||
// {
|
|
||||||
// path: 'user',
|
|
||||||
// name: 'user',
|
|
||||||
// meta: {
|
|
||||||
// title: '用户',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/user')
|
|
||||||
// },
|
|
||||||
// // 系统 按钮配置
|
|
||||||
// {
|
|
||||||
// path: 'button',
|
|
||||||
// name: 'button',
|
|
||||||
// meta: {
|
|
||||||
// title: '按钮',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/button')
|
|
||||||
// },
|
|
||||||
// // // 系统 菜单权限
|
|
||||||
// {
|
|
||||||
// path: 'menuButton/:id',
|
|
||||||
// name: 'menuButton',
|
|
||||||
// meta: {
|
|
||||||
// title: '菜单按钮',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/menuButton')
|
|
||||||
// },
|
|
||||||
// // 系统 角色管理
|
|
||||||
// {
|
|
||||||
// path: 'role',
|
|
||||||
// name: 'role',
|
|
||||||
// meta: {
|
|
||||||
// title: '角色',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/role')
|
|
||||||
// },
|
|
||||||
// // 系统 角色权限
|
|
||||||
// {
|
|
||||||
// path: 'rolePermission',
|
|
||||||
// name: 'rolePermission',
|
|
||||||
// meta: {
|
|
||||||
// title: '权限管理',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/rolePermission')
|
|
||||||
// },
|
|
||||||
|
|
||||||
// // 系统 角色管理
|
|
||||||
// {
|
|
||||||
// path: 'dept',
|
|
||||||
// name: 'dept',
|
|
||||||
// meta: {
|
|
||||||
// title: '部门',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/dept')
|
|
||||||
// },
|
|
||||||
// // 系统 操作日志
|
|
||||||
// {
|
|
||||||
// path: 'operationLog',
|
|
||||||
// name: 'operationLog',
|
|
||||||
// meta: {
|
|
||||||
// title: '操作日志',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/log/operationLog')
|
|
||||||
// },
|
|
||||||
// 系统 前端日志
|
|
||||||
// {
|
|
||||||
// path: 'frontendLog',
|
|
||||||
// name: 'frontendLog',
|
|
||||||
// meta: {
|
|
||||||
// title: '前端日志',
|
|
||||||
// auth: true
|
|
||||||
// },
|
|
||||||
// component: _import('system/log/frontendLog')
|
|
||||||
// },
|
|
||||||
// 刷新页面 必须保留
|
// 刷新页面 必须保留
|
||||||
{
|
{
|
||||||
path: 'refresh',
|
path: 'refresh',
|
||||||
|
@ -201,7 +82,7 @@ if (pluginsType) {
|
||||||
* 错误页面
|
* 错误页面
|
||||||
*/
|
*/
|
||||||
const errorPage = [{
|
const errorPage = [{
|
||||||
path: '*',
|
path: '/404',
|
||||||
name: '404',
|
name: '404',
|
||||||
component: _import('system/error/404')
|
component: _import('system/error/404')
|
||||||
}]
|
}]
|
||||||
|
|
Loading…
Reference in New Issue