fix: vip info

This commit is contained in:
zzc
2026-01-30 17:48:48 +08:00
parent 360947e0fc
commit 462e664ac9
3 changed files with 28 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
import { defineStore } from "pinia";
import { wxLogin, wxGetUserProfile } from "@/utils/login.js";
import { getPlatformProvider } from "@/utils/system";
import { getUserInfo } from "@/api/auth.js";
export const useUserStore = defineStore("user", {
state: () => ({
@@ -44,6 +45,17 @@ export const useUserStore = defineStore("user", {
}
}
},
async fetchUserInfo() {
try {
const res = await getUserInfo();
console.log(1111, res);
if (res) {
this.setUserInfo(res);
}
} catch (e) {
console.error("fetchUserInfo error", e);
}
},
logout() {
this.userInfo = {};
this.token = "";