fix: youhua

This commit is contained in:
zzc
2026-06-10 00:45:45 +08:00
parent d325329af4
commit 21bfa3efd8
4 changed files with 28 additions and 36 deletions

View File

@@ -118,7 +118,7 @@ const userInfo = computed(() => ({
isVip: userStore.userInfo.isVip || false,
}));
const isLoggedIn = computed(() => !!userStore.userInfo.nickName);
const isLoggedIn = computed(() => !!userStore.token || !!userStore.userInfo.nickName);
// User Stats
const userStats = ref({
@@ -129,7 +129,15 @@ const userStats = ref({
});
const loadUserStats = async () => {
if (!isLoggedIn.value) return;
if (!isLoggedIn.value) {
userStats.value = {
participant: 0,
comment: 0,
liked: 0,
label: []
};
return;
}
try {
const res = await fetchUserNums();
const data = res?.data || res || {};