fix
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-03-09 19:55:46 +08:00
parent b82840c692
commit 52d25f8b41
2 changed files with 12 additions and 2 deletions

View File

@@ -47,10 +47,19 @@ async function loadSimilarProblems() {
similarLoaded.value = true
}
// 切换题目时重置相似推荐状态
watch(
() => problem.value?._id,
() => {
similarProblems.value = []
similarLoaded.value = false
},
)
// AC 或失败次数 >= 3 时加载推荐
watch(
() => [problem.value?.my_status, problemStore.totalFailCount],
([status, failCount]) => {
() => [problem.value?._id, problem.value?.my_status, problemStore.totalFailCount],
([, status, failCount]) => {
if (status === 0 || (failCount as number) >= 3) {
loadSimilarProblems()
}

View File

@@ -104,6 +104,7 @@ async function init() {
}
}
onMounted(init)
watch(() => props.problemID, init)
onBeforeUnmount(() => {
problem.value = null
errMsg.value = "无数据"