diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 6ddb154..a25debe 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -301,6 +301,7 @@ export default { const projectId = Number(pId || this.projectId) const cid = this.courseId const assessmentId = this.assessmentId + const list = this.projectList let points = [] if (pId && cache.judgmentIdList) { cache.judgmentIdList.map(e => { @@ -313,7 +314,7 @@ export default { points = JSON.parse(JSON.stringify(this.points)) } // 如果是没有代码的缓存,则只需要恢复项目,否则,就调接口查询缓存代码 - if (cache && cache.empty) { + if (cache && cache.empty && list.find(e => e.projectId === projectId)) { this.projectId = projectId this.closeLoad() localStorage.removeItem('codeCache') diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index 139a2dc..8d8bdef 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -29,7 +29,7 @@
-

{{ runResult }}

+

{{ runResult }}