From 4df0471b7dff0494625ff09969b1a13b5359a26e Mon Sep 17 00:00:00 2001 From: XingChuan <m17600301067@163.com> Date: 星期一, 31 五月 2021 22:41:47 +0800 Subject: [PATCH] 统计表弹框UI优化;增加点击企业名称缩放至企业;二级表展示功能优化。 --- src/router/index.js | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 99f1696..bcc7434 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,13 +1,15 @@ import Vue from 'vue' import Router from 'vue-router' import { routes } from './routes' +import { getToken } from '@/utils/navigation' import 'nprogress/nprogress.css' const appConfig = require('@/app.config') -const { routeMode } = appConfig - +const { homeRouterName, loginRouteName, routeMode } = appConfig +const LOGIN_PAGE_ROUTE_NAME = loginRouteName Vue.use(Router) +const baseName = process.env.NODE_ENV === 'production' ? `/${appConfig.projectName}/` : '/' const router = new Router({ - base: appConfig.projectName, + base: baseName, mode: routeMode || 'hash', routes: routes }) @@ -16,12 +18,37 @@ cancel() }) Vue.prototype.$cancels = [] + const token = getToken() + if (!token && to.name !== LOGIN_PAGE_ROUTE_NAME) { + // 鏈櫥褰曚笖瑕佽烦杞殑椤甸潰涓嶆槸鐧诲綍椤� + /* next({ + name: LOGIN_PAGE_ROUTE_NAME // 璺宠浆鍒扮櫥褰曢〉 + }) */ + next() // 璺宠浆 + } else if (!token && to.name === LOGIN_PAGE_ROUTE_NAME) { + // 鏈櫥闄嗕笖瑕佽烦杞殑椤甸潰鏄櫥褰曢〉 + next() // 璺宠浆 + } else if (token && to.name === LOGIN_PAGE_ROUTE_NAME) { + // 宸茬櫥褰曚笖瑕佽烦杞殑椤甸潰鏄櫥褰曢〉 + // next({ + // name: homeRouterName // 璺宠浆鍒癶omeName椤� + // }) + console.log(homeRouterName) + next() + } else if (!token) { + // next({ + // name: LOGIN_PAGE_ROUTE_NAME // 璺宠浆鍒扮櫥褰曢〉 + // }) + console.log(LOGIN_PAGE_ROUTE_NAME) + next() + } else { + next() + } // 涓嶉渶瑕佺櫥褰曡璇佺殑璺敱 if (Object.hasOwnProperty.call(to.meta, 'noLoginIdentify') && to.meta.noLoginIdentify) { next() - return } - next() + // next() }) router.beforeResolve((to, from, next) => { next() -- Gitblit v1.8.0