From ab82cce8b5fdad6b3a5aa2251040828ff24b4483 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 8 Apr 2022 16:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E4=BC=B4=E9=9A=8F=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=8F=82=E6=95=B0=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/case/index.vue | 13 +------------ src/pages/counter/list/index.vue | 7 +------ src/pages/index/list/index.vue | 5 +---- src/router/permission.js | 18 ++++++++++-------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/components/case/index.vue b/src/components/case/index.vue index 9278461..164e0c2 100644 --- a/src/components/case/index.vue +++ b/src/components/case/index.vue @@ -586,16 +586,6 @@ export default { }).catch((error)=>{ }) }, - // 跳转 - toPage(token, cid, systemId) { - const url = location.href - const host = url.includes('occupationlab.com') ? - `http://www.huorantech.cn/banksystem` : - process.env.NODE_ENV === 'development' ? - `http://192.168.31.155:8093` : - `http://39.108.250.202/banksystem` - location.href = `${host}/#/index/list?token=${token}&cid=${cid}&systemId=${systemId}` - }, //选择好题目 selectProject(){ this.lockIt = false @@ -646,7 +636,7 @@ export default { this.projectId = data.data.projectManage.projectId; this.projectManage = data.data.projectManage; this.requires = data.data.projectJudgmentVos; - this.toPage(token, cid, systemId) + this.$router.push('/index/list') } }).catch((error)=>{ }) @@ -873,7 +863,6 @@ export default { this.grade = '00' this.$router.push('/index/list') this.getBeginTime() - this.toPage(token, cid, systemId) }, checkVer() { diff --git a/src/pages/counter/list/index.vue b/src/pages/counter/list/index.vue index cb49fa2..96b0fd0 100644 --- a/src/pages/counter/list/index.vue +++ b/src/pages/counter/list/index.vue @@ -1402,12 +1402,7 @@ export default { }, showManage() {// 展示系统管理 this.manageVisible = true; - const path = sessionStorage.getItem('computerPath') - if(path) { - this.$router.push(path) - }else { - this.$router.push('/counter/list/manage/consumerClient'); - } + this.$router.push(sessionStorage.getItem('computerPath') || '/counter/list/manage/consumerClient') }, popSure(){/* 弹框-确定 */ // 拦截 由于下面太多没拦截的,所以在这拦截舒服 diff --git a/src/pages/index/list/index.vue b/src/pages/index/list/index.vue index 6434663..d749a61 100644 --- a/src/pages/index/list/index.vue +++ b/src/pages/index/list/index.vue @@ -114,10 +114,7 @@ export default { } }, toPart(path){ - this.$router.push({ - path, - query: this.$route.query - }) + this.$router.push(path) }, showComing(){ this.comingVisible = true diff --git a/src/router/permission.js b/src/router/permission.js index 9507649..49639a8 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -4,12 +4,14 @@ import util from '@/libs/util' router.beforeEach((to, from, next) => { document.title = Setting.titleSuffix - const role = util.local.get(Setting.tokenKey) - // if (!role && to.path !== '/login') { - // next('/login') - // } else if(role && to.path == '/login') { - // next('/index') - // } else { - next() - // } + // 全局伴随参数 + if (to.query.token) { + next() + } else { + next({ + path: to.path, + query: Object.assign(from.query, to.query) + }) + } + }); \ No newline at end of file