From a88cb5f6275c79d82828fff7ccd86a78da4f34df Mon Sep 17 00:00:00 2001 From: 18154758993 <605281283@qq.com> Date: Fri, 10 Oct 2025 23:35:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=8E=92=E5=90=8D=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/comprehensive/knzzGlApply/stu.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/views/comprehensive/knzzGlApply/stu.vue b/src/views/comprehensive/knzzGlApply/stu.vue index ed4c72c..6a1de7d 100644 --- a/src/views/comprehensive/knzzGlApply/stu.vue +++ b/src/views/comprehensive/knzzGlApply/stu.vue @@ -523,17 +523,22 @@ export default { async fetchcjpm() { let loading = fullLoading(this); let res = await getOwnStuScoreMajorRank().catch(error => { - console.error("Error fetching score rank:", error); return { code: 500 }; }); loading.close(); - if (res.code === 200 && res.data && res.data.majorRank != null && res.data.majorCount != null) { + if (res.code === 200 && res.data) { let data = res.data; - let stuRank = Math.round(Math.round(data.majorRank / data.majorCount * 10000) / 100); - if (stuRank <= 30) { - return true; + // 检查必要的字段是否存在 + if (data.majorRank !== undefined && data.majorCount !== undefined && data.majorCount > 0) { + let stuRank = Math.round(Math.round(data.majorRank / data.majorCount * 10000) / 100); + if (stuRank <= 30) { + return true; + } else { + this.$message.info("您的学业成绩未达到专业前30%"); + return false; + } } else { - this.$message.info("您的学业成绩未达到专业前30%"); + this.$message.info("专业排名数据不完整"); return false; } }