清除缓存代码,考核缓存

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', queryTestProject: 'occupationlab/projectManage/getProjectBySystemId',
saveCache: 'python/python/saveCache', saveCache: 'python/python/saveCache',
getLastCache: 'python/python/getLastCache', getLastCache: 'python/python/getLastCache',
delCache: 'python/python/delCache',
getDetailById: 'occupationlab/assessment/getDetailById', getDetailById: 'occupationlab/assessment/getDetailById',
pageStuAssessment: 'occupationlab/assessment/pageStuAssessment' pageStuAssessment: 'occupationlab/assessment/pageStuAssessment'
} }

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

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

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

Loading…
Cancel
Save