|
@@ -30,7 +30,7 @@ export const useUserStore = defineStore('user',
|
|
|
localStorage.setItem('accountInfo', JSON.stringify(res))
|
|
|
localStorage.setItem('expiresTime', res.expiresTime) // token过期时间
|
|
|
this.getUserInfos()
|
|
|
- this.getUserBaseInfos()
|
|
|
+ if (!this.loginType) this.getUserBaseInfos()
|
|
|
resolve()
|
|
|
}).catch(err => { reject(err) })
|
|
|
})
|
|
@@ -47,7 +47,7 @@ export const useUserStore = defineStore('user',
|
|
|
localStorage.setItem('accountInfo', JSON.stringify(res))
|
|
|
localStorage.setItem('expiresTime', res.expiresTime) // token过期时间
|
|
|
this.getUserInfos()
|
|
|
- this.getUserBaseInfos()
|
|
|
+ if (!this.loginType) this.getUserBaseInfos()
|
|
|
resolve()
|
|
|
}).catch(err => { reject(err) })
|
|
|
})
|
|
@@ -67,7 +67,7 @@ export const useUserStore = defineStore('user',
|
|
|
async getUserBaseInfos (userId = null) {
|
|
|
try {
|
|
|
const api = this.loginType ? null : getBaseInfo
|
|
|
- if (!api) return localStorage.setItem('baseInfo', JSON.stringify(null))
|
|
|
+ if (!api) return
|
|
|
const data = await api({ userId: userId || this.accountInfo.userId })
|
|
|
this.baseInfo = await this.getFieldText(data)
|
|
|
localStorage.setItem('baseInfo', JSON.stringify(this.baseInfo))
|