revert
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-06-04 08:56:47 -06:00
parent 4aa0072567
commit 8549b6c177
3 changed files with 9 additions and 12 deletions

View File

@@ -109,9 +109,6 @@ function onUsernameChange() {
onMounted(() => {
aiStore.fetchHeatmapData()
if (!aiStore.targetUsername) {
aiStore.fetchPinnedReport()
}
})
watch(

View File

@@ -10,7 +10,7 @@
<template v-if="aiStore.pinnedReport">
<MdPreview :model-value="aiStore.pinnedReport.analysis" />
</template>
<template v-else-if="!aiStore.loading.pinned">
<template v-else>
<n-button
v-if="!aiStore.mdContent && !aiStore.loading.ai"
type="primary"
@@ -43,6 +43,12 @@ async function handleAnalyze() {
}
await aiStore.fetchAIAnalysis()
}
onMounted(async () => {
if (!aiStore.targetUsername) {
await aiStore.fetchPinnedReport()
}
})
</script>
<style scoped>
.cool-title {

View File

@@ -24,7 +24,6 @@ export const useAIStore = defineStore("ai", () => {
fetching: false, // 合并 details 和 duration 的 loading
ai: false,
heatmap: false,
pinned: true,
})
const mdContent = ref("")
@@ -159,13 +158,8 @@ export const useAIStore = defineStore("ai", () => {
}
async function fetchPinnedReport() {
loading.pinned = true
try {
const res = await getAIPinnedReport()
pinnedReport.value = res.data
} finally {
loading.pinned = false
}
const res = await getAIPinnedReport()
pinnedReport.value = res.data
}
return {