From e2b6ca9f117e0707a22cbc3d7c65c2e4cac89ac1 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Sat, 2 Apr 2022 18:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/header/index.vue | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index c221eb9..58b41b8 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -33,15 +33,21 @@ export default { }) }, exit(){ - let assessmentId = sessionStorage.getItem('assessmentId') - if (assessmentId != 'null' && assessmentId != null && assessmentId != ''){ - window.location = 'http://39.108.250.202/student/#/ass/list' - // window.location = 'http://www.occupationlab.com/#/ass/list' - }else{ - let cid = sessionStorage.getItem('cid') - window.location = 'http://39.108.250.202/student/#/station/preview?courseId='+cid+'&curriculumName=银行项目' - // window.location = 'http://www.occupationlab.com/#/station/preview?courseId='+cid+'&curriculumName=银行项目' - } + let href = '' + const url = location.href + const host = url.includes('huorantech.cn') ? + `http://www.occupationlab.com` : + process.env.NODE_ENV === 'development' ? + `http://192.168.31.155:8082` : + `http://39.108.250.202/student` + let assessmentId = sessionStorage.getItem('assessmentId') + if (assessmentId != 'null' && assessmentId != null && assessmentId != ''){ + href = `${host}/#/ass/list` + }else{ + const cid = sessionStorage.getItem('cid') + href = `${host}/#/station/preview?courseId=${cid}&curriculumName=银行项目` + } + location.href = href }, }, };