feat: 新功能改进 #20

Merged
hera merged 57 commits from feat/next-improvements into main 2026-04-10 20:30:37 +00:00
Showing only changes of commit fc04539b28 - Show all commits

View File

@@ -1029,6 +1029,16 @@ async function saveAllParsed() {
}
const sharedCount = ref({ adopted: 0, total: 0 })
async function loadContribution() {
try {
const res = await api('/api/me/contribution')
if (res.ok) {
const data = await res.json()
sharedCount.value = { adopted: data.adopted_count || 0, total: data.shared_count || 0 }
}
} catch {}
}
const previewRecipeIndex = ref(null)
const showBatchMenu = ref(false)
const showBatchTagPicker = ref(false)
@@ -1065,13 +1075,7 @@ function formatDate(d) {
onMounted(async () => {
if (auth.isLoggedIn) {
await diaryStore.loadDiary()
try {
const res = await api('/api/me/contribution')
if (res.ok) {
const data = await res.json()
sharedCount.value = { adopted: data.adopted_count || 0, total: data.shared_count || 0 }
}
} catch {}
await loadContribution()
}
if (auth.isAdmin) {
try {
@@ -1159,6 +1163,7 @@ async function shareDiaryToPublic(diary) {
ui.showToast('已提交,等待管理员审核')
}
await recipeStore.loadRecipes()
await loadContribution()
}
} catch {
ui.showToast('共享失败')