♻️ userStore 及 cookie 相关类型重构 #51

This commit is contained in:
BTMuli
2023-12-16 22:07:31 +08:00
parent 00386bc7ee
commit 4370bbaa57
16 changed files with 267 additions and 236 deletions

View File

@@ -171,18 +171,12 @@ const userStore = useUserStore();
const isDevEnv = ref<boolean>(import.meta.env.MODE === "development");
const userInfo = computed(() => {
if (appStore.isLogin) {
const info = userStore.getBriefInfo();
return {
nickname: info.nickname,
avatar: info.avatar,
};
} else {
return {
nickname: "未登录",
avatar: "/source/UI/defaultUser.webp",
};
}
const info = userStore.getBriefInfo();
if (info && info.nickname) return info;
return {
nickname: "未登录",
avatar: "/source/UI/defaultUser.webp",
};
});
const rail = ref(appStore.sidebar.collapse);
// theme