From ead39d68032b6b6540ce03edc4bd4fc9c2f77e04 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 25 May 2021 17:20:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=88=86=E5=9F=BA=E7=A1=80=E5=92=8C?= =?UTF-8?q?=E6=8C=91=E6=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page/Assessment.vue | 2 +- src/config/index.js | 8 ++++++-- src/utils/core.js | 17 ++++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/components/page/Assessment.vue b/src/components/page/Assessment.vue index 68317ad..7929721 100644 --- a/src/components/page/Assessment.vue +++ b/src/components/page/Assessment.vue @@ -239,7 +239,7 @@ export default { }else if(row.status == 3){ return this.$message.warning('该实验已经结束') }else{ - this.core.toSubSystem(row.className,row.id,row.classId) + this.core.toSubSystem(row.className,row.id,row.classId,this.pattern) } }, show(row) { diff --git a/src/config/index.js b/src/config/index.js index 815cd2f..c3981df 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -10,7 +10,11 @@ export default { */ locale: 'zh', /** - * @description 跳转子系统链接 + * @description 基础模式子系统链接 */ - subSystem: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/first' : 'http://122.9.154.146/first' + subSystem1: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kd/#/Dashboard' : 'http://122.9.154.146/kd/#/Dashboard', + /** + * @description 挑战模式子系统链接 + */ + subSystem2: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdChallenge/#/Dashboard' : 'http://122.9.154.146/kdChallenge/#/Dashboard' } \ No newline at end of file diff --git a/src/utils/core.js b/src/utils/core.js index 4339f7c..22764c1 100644 --- a/src/utils/core.js +++ b/src/utils/core.js @@ -158,7 +158,7 @@ function getCaption(obj){ return obj; } -function toSubSystem(className = '',id = '',classId = ''){ +function toSubSystem(className = '',id = '',classId = '',pattern = ''){ sessionStorage.setItem("token",store.state.token);//token sessionStorage.setItem("userName",store.state.userName);//用户名 sessionStorage.setItem("class",className);//班级名 @@ -182,12 +182,15 @@ function toSubSystem(className = '',id = '',classId = ''){ source:source } this.$get(this.api.queryProjectIdAndPattenById,params).then(res => { - let projectId = res.Info.projectId - let pattern = res.Info.pattern - sessionStorage.setItem("id",projectId) -}) -} - location.href = config.subSystem + let projectId = res.Info.projectId + let pattern = res.Info.pattern + sessionStorage.setItem("id",projectId) + location.href = pattern === 0 ? config.subSystem1 : config.subSystem2 + }) + }else{ + location.href = config.subSystem1 + } + } function encodeString(str) {