소스 검색

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 ?? ''