瀏覽代碼

fix: profile exception when there is no attribute

Casper Dai 3 年之前
父節點
當前提交
0212e45fc1
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/views/platform/profile/index.vue

+ 3 - 0
src/views/platform/profile/index.vue

@@ -244,6 +244,9 @@ export default {
       })
     },
     setUserInfo (data) {
+      if (!data.attributes) {
+        data.attributes = {}
+      }
       this.avatar = this.getOrCreateAttribute(data, 'avatar', '')
       this.phone = this.getOrCreateAttribute(data, 'phone', '')
       this.email = data.email ?? ''