用户资料显示

This commit is contained in:
2025-11-14 20:50:25 +08:00
parent 710d72aefe
commit 4a69b2a5aa
4 changed files with 37 additions and 6 deletions
+3
View File
@@ -8,6 +8,7 @@ import { my_network_func } from "@/my_network_func";
export const useUserStore = defineStore("user", () => {
// 状态 (State)
const userInfo = ref(null);
const user =ref(null)
const userCookie = ref(null);
const isLoggedIn = ref(false);
@@ -29,6 +30,7 @@ export const useUserStore = defineStore("user", () => {
case 200:
switch (r.data.err_code) {
case 0:
user.value=r.data.return.user
if(r.data.return.userInfo){
userInfo.value=r.data.return.userInfo
}else{
@@ -86,6 +88,7 @@ export const useUserStore = defineStore("user", () => {
};
return {
user,
userInfo,
userCookie,
isLoggedIn,