清除缓存代码,考核缓存

ui
jialong.yu 3 years ago
parent 0a63968750
commit 26628a094c
  1. 1
      src/api/index.js
  2. 22
      src/components/TestPanel.vue
  3. 17
      src/config/index.js
  4. 1
      src/views/Home.vue

@ -6,6 +6,7 @@ export default {
queryTestProject: 'occupationlab/projectManage/getProjectBySystemId',
saveCache: 'python/python/saveCache',
getLastCache: 'python/python/getLastCache',
delCache: 'python/python/delCache',
getDetailById: 'occupationlab/assessment/getDetailById',
pageStuAssessment: 'occupationlab/assessment/pageStuAssessment'
}

@ -175,7 +175,7 @@ export default {
};
},
mounted() {
this.projectPermissions = this.projectId ? 1 : 0 // /
this.projectPermissions = this.projectId ? 1 : 0 // 10
if(this.projectId){ // projectId)
this.getAssList()
}else{ //
@ -269,7 +269,9 @@ export default {
}
})
if (!done) {
this.getList()
this.getList().then(() => {
this.getCache()
}).catch(res => {})
//
this.statusTimer = setInterval(_ => {
this.getStatus()
@ -281,10 +283,13 @@ export default {
getCache(pId, jId) {
const projectId = pId || this.projectId
const judgmentId = jId || this.judgmentId
const cid = this.courseId
const assessmentId = this.assessmentId
this.$post(this.api.getLastCache, {
assessmentId: assessmentId ? Number(assessmentId) : '',
bcId: judgmentId, // ididid
projectId, // id
cid: this.courseId // id
cid // id
}).then(res => {
const code = res.getLastCache
//
@ -314,13 +319,20 @@ export default {
}
}).catch(() => {
localStorage.removeItem('codeCache')
this.$post(`${this.api.delCache}`, {
assessmentId,
bcId: judgmentId,
projectId,
cid
}).then(res => {}).catch(() => {})
})
}
}).catch(res => {})
},
//
getStatus() {
this.$get(this.api.getDetailById, {
//
this.isSubmit || this.$get(this.api.getDetailById, {
id: this.assessmentId
}).then(res => {
const done = res.data ? res.data.status === 2 : false // (0 1 2)
@ -376,6 +388,7 @@ export default {
},
//
submit() {
if (this.isSubmit) return false
const pointList = this.$parent.workbench
const date = new Date()
const entryTime = this.entryTime
@ -414,6 +427,7 @@ export default {
localStorage.removeItem('codeCache')
this.isSubmit = true
newmain.$emit('isSubmit', this.isSubmit)
clearInterval(this.statusTimer)
let list = res.retInfo
let taskList = this.taskList
var score = 0

@ -1,15 +1,12 @@
const isHh = location.host.includes('10.196.131.73') //是否是河海版本
const isBeta = process.env.NODE_ENV === 'development' || location.host.includes('120.78.198.231') //是否是职站测试
const isPro = location.host.includes('occupationlab.com') //是否是职站生产
const isBeta = process.env.NODE_ENV === 'development' || location.host.includes('39.108.250.202') //是否是职站测试
let host = "";
if(isHh) {
host = "http://10.196.131.73/";
} else if(isBeta) {
host = "http://39.108.250.202:9000/";
host = "http://192.168.31.151:9000/";
} else if(isPro) {
host = "http://www.occupationlab.com/";
let host = ''
if(isBeta) {
host = 'http://39.108.250.202:9000'
// host = 'http://192.168.31.151:9000'
} else {
host = location.origin + '/'
}
export default {

@ -86,6 +86,7 @@ export default {
list.map(e => {
if (e.code) {
let data = {
assessmentId: this.assessmentId,
code: e.code,
bcId: e.judgmentId,
cid: this.courseId,

Loading…
Cancel
Save