用户信息接口对接Mock数据

This commit is contained in:
付民康
2025-03-17 19:25:02 +08:00
parent babcfda6bf
commit ecdb6e92b9
7 changed files with 17 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ export interface AccountInfo {
export const useAccountStore = defineStore('accountInfo', () => {
const cacheInfo = localStorage.getItem('userInfo');
const isLogin = ref(Boolean(localStorage.getItem('access_token')));
const userInfo = cacheInfo ? JSON.parse(cacheInfo) : {};
const userInfo = cacheInfo ? JSON.parse(cacheInfo).data : {};
const accountInfo = reactive<AccountInfo>({
access_token: localStorage.getItem('access_token') || '',
refresh_token: localStorage.getItem('refresh_token') || '',