Browse Source

fix: profile exception when there is no attribute

Casper Dai 3 năm trước cách đây
mục cha
commit
0212e45fc1
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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 ?? ''