feat(personal-center): 实现个人信息功能

This commit is contained in:
caozehui
2026-05-15 16:05:56 +08:00
parent 0c6ed249ee
commit 480714172e
8 changed files with 921 additions and 2 deletions

View File

@@ -172,6 +172,18 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
return false;
}
async function refreshUserInfo() {
const { data: info, error } = await fetchGetUserInfo(true);
if (!error) {
Object.assign(userInfo, info);
return true;
}
return false;
}
async function initUserInfo() {
const hasToken = getToken();
@@ -194,6 +206,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
loginLoading,
resetStore,
login,
initUserInfo
initUserInfo,
refreshUserInfo
};
});