diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 9780f27..2475c54 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -253,18 +253,17 @@ export default { const list = res.list const assessmentId = this.assessmentId let done = false - list.map(e => { - // 匹配到该考核,并且已经提交过(有reportId则说明有实验记录) - if (e.assessmentId == assessmentId && e.reportId) { - done = true - this.isSubmit = true - newmain.$emit('isSubmit', this.isSubmit) - this.$message.error('你已经提交过该考核!') - setTimeout(_ => { - history.back() // 直接返回上一页面 - }, 1500) - } - }) + const classId = this.classId + // 匹配到该考核,并且已经提交过(有reportId则说明有实验记录),并且classId跟当前用户的classId相同,就提示提交了考核然后返回上一页 + if (list.find(e => e.assessmentId == assessmentId && e.reportId && e.classId == classId)) { + done = true + this.isSubmit = true + newmain.$emit('isSubmit', this.isSubmit) + this.$message.error('你已经提交过该考核!') + setTimeout(_ => { + history.back() // 直接返回上一页面 + }, 1500) + } // 如果该考核没有提交过,则取获取项目列表进行考核 if (!done) { this.getList().then(() => { diff --git a/src/config/index.js b/src/config/index.js index c5fb68b..a8a0921 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -3,7 +3,8 @@ import util from '@/util' const isHh = location.host.includes('10.196.131.73') //是否是河海版本 const isBeta = process.env.NODE_ENV === 'development' || location.host.includes('39.108.250.202') //是否是职站测试 -const host = location.origin + ':9000/' +let host = location.origin + ':9000/' +if (process.env.NODE_ENV === 'development') host = "http://192.168.31.151:9000/" /** * python8个系统的id和名称 * id即systemId,从cookie里取