功能变化: 兼容租户模式
parent
83c702298a
commit
863be2044a
|
@ -86,10 +86,27 @@ router.beforeEach(async (to, from, next) => {
|
|||
})
|
||||
} else {
|
||||
const childrenPath = window.qiankunActiveRule || []
|
||||
// 判断,是否是租户模式
|
||||
if (to.path !== '/clientRenew' && store.state.d2admin.user.info.tenant_id) {
|
||||
// 如果租户到期,跳转到续费页面
|
||||
if (store.state.d2admin.user.info.tenant_expire) {
|
||||
next({ path: '/clientRenew' })
|
||||
// 取消当前导航
|
||||
NProgress.done()
|
||||
return
|
||||
// 如果是普通租户,如果没有试用套餐,且是试用阶段
|
||||
} else if (store.state.d2admin.user.info.tenant_id !== 100000 && !store.state.d2admin.user.info.package_manage && store.state.d2admin.user.info.tenant_experience) {
|
||||
next({ path: '/clientRenew' })
|
||||
// 取消当前导航
|
||||
NProgress.done()
|
||||
return
|
||||
}
|
||||
}
|
||||
if (to.name) {
|
||||
if (to.meta.openInNewWindow && (from.query.newWindow && to.query.newWindow !== '1' || from.path === '/')) {
|
||||
if (to.meta.openInNewWindow && ((from.query.newWindow && to.query.newWindow !== '1') || from.path === '/')) {
|
||||
to.query.newWindow = '1'
|
||||
}
|
||||
|
||||
// 有 name 属性,说明是主应用的路由
|
||||
if (to.meta.openInNewWindow && !to.query.newWindow && !from.query.newWindow && from.path !== '/') {
|
||||
// 在新窗口中打开路由
|
||||
|
@ -101,6 +118,8 @@ router.beforeEach(async (to, from, next) => {
|
|||
NProgress.done()
|
||||
next(false)
|
||||
} else {
|
||||
// 取消当前导航
|
||||
NProgress.done()
|
||||
next()
|
||||
}
|
||||
} else if (childrenPath.some((item) => to.path.includes(item))) {
|
||||
|
|
|
@ -66,7 +66,7 @@ export default {
|
|||
* @param {Object} context
|
||||
* @param {Object} payload confirm {Boolean} 是否需要确认
|
||||
*/
|
||||
logout ({ commit, dispatch }, { confirm = false } = {}) {
|
||||
logout ({ commit, dispatch }, { confirm = false, refresh = true } = {}) {
|
||||
/**
|
||||
* @description 注销
|
||||
*/
|
||||
|
@ -87,7 +87,9 @@ export default {
|
|||
|
||||
// 跳转路由
|
||||
router.push({ name: 'login' })
|
||||
router.go(0)
|
||||
if (refresh) {
|
||||
router.go(0)
|
||||
}
|
||||
}
|
||||
// 判断是否需要确认
|
||||
if (confirm) {
|
||||
|
|
Loading…
Reference in New Issue