소스 검색

没有数据return

Xiao_123 11 달 전
부모
커밋
976233312b
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/store/user.js

+ 1 - 0
src/store/user.js

@@ -68,6 +68,7 @@ export const useUserStore = defineStore('user',
           const api = this.loginType ? null : getBaseInfo
           const api = this.loginType ? null : getBaseInfo
           if (!api) return
           if (!api) return
           const data = await api({ userId: userId || this.accountInfo.userId })
           const data = await api({ userId: userId || this.accountInfo.userId })
+          if (!data) return
           this.baseInfo = await this.getFieldText(data)
           this.baseInfo = await this.getFieldText(data)
           localStorage.setItem('baseInfo', JSON.stringify(this.baseInfo))
           localStorage.setItem('baseInfo', JSON.stringify(this.baseInfo))
         } catch (error) {
         } catch (error) {