From 1ba8bfdb98d2f9109fd1a854420377b65640e4cc Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 18 Apr 2022 17:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=9B=BE=E7=89=87=E7=AD=89?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TestPanel.vue | 3 ++- src/components/codemirror.vue | 10 ++++++++-- vue.config.js | 20 -------------------- 3 files changed, 10 insertions(+), 23 deletions(-) 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 }}