|
@@ -5,15 +5,6 @@ import { closeAuthModal, showAuthModal } from '@/hooks/useModal'
|
|
import { timesTampChange } from '@/utils/date'
|
|
import { timesTampChange } from '@/utils/date'
|
|
import { getBaseInfoDictOfName } from '@/utils/getText'
|
|
import { getBaseInfoDictOfName } from '@/utils/getText'
|
|
|
|
|
|
-// 默认用户信息
|
|
|
|
-const defaultBaseInfo = {
|
|
|
|
- avatar: '', // 头像
|
|
|
|
- nickname: '', // 昵称
|
|
|
|
- gender: 0, // 性别
|
|
|
|
- mobile: '', // 手机号
|
|
|
|
- point: 0, // 积分
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
// 默认账户信息
|
|
// 默认账户信息
|
|
const defaultAccountInfo = {
|
|
const defaultAccountInfo = {
|
|
accessToken: '',
|
|
accessToken: '',
|
|
@@ -120,9 +111,6 @@ export const userStore = defineStore('user', {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.lastUpdateTime = nowTime;
|
|
this.lastUpdateTime = nowTime;
|
|
-
|
|
|
|
- // 获取最新信息
|
|
|
|
- return this.baseInfo;
|
|
|
|
},
|
|
},
|
|
|
|
|
|
// 重置用户默认数据
|
|
// 重置用户默认数据
|
|
@@ -130,8 +118,9 @@ export const userStore = defineStore('user', {
|
|
// 清空 token
|
|
// 清空 token
|
|
this.setToken();
|
|
this.setToken();
|
|
// 清空用户相关的缓存
|
|
// 清空用户相关的缓存
|
|
- this.baseInfo = { ...defaultBaseInfo };
|
|
|
|
this.userInfo = {}
|
|
this.userInfo = {}
|
|
|
|
+ this.phone = ''
|
|
|
|
+ this.userAccountInfo = {}
|
|
this.accountInfo = { ...defaultAccountInfo };
|
|
this.accountInfo = { ...defaultAccountInfo };
|
|
},
|
|
},
|
|
|
|
|