diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 7e0d39b..3ecf153 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -335,7 +335,7 @@ export default { const { data } = await this.$get(`${this.api.getTheMostRecentlyRunProject}`, { cid: this.courseId }) - if (data.length) this.projectId = data[0].projectId + if (data && data.length) this.projectId = data[0].projectId } else { Cookie.set('admin-loaded', 1) // 初次加载的标识 } @@ -642,9 +642,9 @@ export default { this.isSelected = true await this.getEntryTime() this.countVal = this.entryTime + this.setSubmit(false) await this.getProDetail() this.getCache() - this.setSubmit(false) this.grade = '00' this.pannelTab = 'first' this.clearReport() @@ -755,7 +755,7 @@ export default { confirmSubmit () { if (this.submiting) return false this.submiting = true - const isVscode = this.$parent.language // 是否选择了vscode + const isVscode = this.$parent.language === 'vscode' // 是否选择了vscode const { taskList } = this const pointList = this.$parent.workbench let msg = '此操作将视为结束考试,是否继续?' @@ -788,7 +788,7 @@ export default { cid: this.courseId, projectId: this.projectId, userAnswer: e.codeResult || null, - type: 0, + type: 'vscode', sort: i }) this.$parent.workbench[i].answer = e.codeResult @@ -805,7 +805,7 @@ export default { bcId: pointList[0].judgmentId, cid: this.courseId, projectId: this.projectId, - type: 0 + type: this.$parent.language }).then(res => { }).catch(err => { this.submiting = false }) diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index 9eac53b..9e60616 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -522,7 +522,7 @@ export default { bcId: this.judgmentId, cid: this.courseId, projectId: this.projectId, - type: 0, + type: Cookie.get('admin-language'), sort: this.index }, { headers: { @@ -652,7 +652,7 @@ export default { bcId, cid, projectId, - type: 0, + type: Cookie.get('admin-language'), sort: this.index }).then(res => { this.$emit('update:finalCode', code) @@ -680,7 +680,7 @@ export default { bcId, cid, projectId, - type: 0, + type: Cookie.get('admin-language'), sort: this.index }).then(res => { this.$emit('update:finalCode', code) diff --git a/src/config/index.js b/src/config/index.js index 328f816..6684696 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -2,7 +2,8 @@ import Cookie from 'js-cookie' const url = location.host const isDev = process.env.NODE_ENV === 'development' //是否本地 -const isTest = url.includes('121.37.12.51') //测试服 +// const isTest = url.includes('121.37.12.51') //测试服 +const isTest = true //测试服 const isHh = url.includes('10.196.131.73') //是否是河海版本 const isPro = url.includes('occupationlab.com') //是否职站生产 const isZxy = url.includes('izhixinyun.com') //是否智信云 @@ -13,7 +14,7 @@ let host = location.origin + '/' let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 if (isDev) { - host = 'http://192.168.31.217:9000/' + host = 'http://192.168.31.51:9000/' // host = 'http://121.37.12.51:9000/' // host = 'https://occupationlab.com/' bankPath = `http://${location.hostname}:8093` diff --git a/src/views/Home.vue b/src/views/Home.vue index 3637720..78ff798 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -11,10 +11,10 @@

{{ $config.title }}

编程语言

- + - 打开Vscode新窗口
@@ -29,7 +29,7 @@ - { - Util.exit() - }, - }) - } else { - localStorage.setItem('opened', 1) - } + Cookie.get('admin-language') || Cookie.set('admin-language', 'python3.7.9') + // const opened = +localStorage.getItem('opened') + // if (opened) { + // localStorage.setItem('opened', opened + 1) + // this.$alert('我们注意到您当前已尝试打开多个实验页面。为保证实验的公平性和诚信,系统仅允许单个实验页面处于活跃状态。', '提示', { + // confirmButtonText: '退出当前页面', + // showClose: false, + // beforeClose: () => { + // Util.exit() + // }, + // }) + // } else { + // this.notAllowed = 0 + // localStorage.setItem('opened', 1) + // } + this.notAllowed = 0 document.onkeydown = function (event) { var e = event || window.event || arguments.callee.caller.arguments[0];