瀏覽代碼

没有数据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
           if (!api) return
           const data = await api({ userId: userId || this.accountInfo.userId })
+          if (!data) return
           this.baseInfo = await this.getFieldText(data)
           localStorage.setItem('baseInfo', JSON.stringify(this.baseInfo))
         } catch (error) {