|
@@ -111,8 +111,9 @@ export const useUserStore = defineStore('user',
|
|
|
async getUserBaseInfos (userId = null) {
|
|
|
try {
|
|
|
// const api = getIsEnterprise() ? null : getBaseInfo
|
|
|
- const data = await getBaseInfo({ userId: userId || this.accountInfo.userId })
|
|
|
- if (!data) return localStorage.setItem('baseInfo', '{}')
|
|
|
+ let data = await getBaseInfo({ userId: userId || this.accountInfo.userId })
|
|
|
+ data = data || {}
|
|
|
+ // if (!data) return localStorage.setItem('baseInfo', '{}')
|
|
|
this.baseInfo = await this.getFieldText(data)
|
|
|
localStorage.setItem('baseInfo', JSON.stringify(this.baseInfo))
|
|
|
localStorage.setItem('necessaryInfoReady', checkPersonBaseInfo(this.baseInfo) ? 'ready' : 'fddeaddc47868b') // 校验是否完善人才必填信息
|
|
@@ -122,6 +123,7 @@ export const useUserStore = defineStore('user',
|
|
|
},
|
|
|
// 字典对应中文
|
|
|
async getFieldText (data) {
|
|
|
+ if (!data || !Object.keys(data).length) return {}
|
|
|
if (data.birthday && data.birthday !== 0) data.birthdayText = timesTampChange(data.birthday, 'Y-M-D') // 出生日期
|
|
|
if (data.firstWorkTime && data.firstWorkTime !== 0) data.firstWorkTimeText = timesTampChange(data.firstWorkTime, 'Y-M-D') // 首次工作时间
|
|
|
if (data.areaId && data.areaId !== 0) await getBaseInfoDictOfName(0, data, data.areaId, 'areaName') // 现居住地text
|