Sfoglia il codice sorgente

refactor(profile): 清理重复的 loadAllData 调用

iwt 2 mesi fa
parent
commit
f24d66da33
1 ha cambiato i file con 1 aggiunte e 5 eliminazioni
  1. 1 5
      cfc-frontend/pages/profile-main/profile.vue

+ 1 - 5
cfc-frontend/pages/profile-main/profile.vue

@@ -315,7 +315,7 @@ export default {
   },
   },
   onShow() {
   onShow() {
     if (!this.isLoggedIn) {
     if (!this.isLoggedIn) {
-      this._watchPageReady()
+      this.loadAllData()
       return
       return
     }
     }
     var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
     var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
@@ -327,12 +327,8 @@ export default {
     this.isSwitchedChild = uni.getStorageSync('isSwitchedChild') || false
     this.isSwitchedChild = uni.getStorageSync('isSwitchedChild') || false
     this.nickname = (uni.getStorageSync('userInfo') || {}).nickname || ''
     this.nickname = (uni.getStorageSync('userInfo') || {}).nickname || ''
     this.loadAllData()
     this.loadAllData()
-    this._watchPageReady()
   },
   },
   methods: {
   methods: {
-    _watchPageReady() {
-      this.loadAllData()
-    },
     loadAllData() {
     loadAllData() {
       this.loadUserInfo()
       this.loadUserInfo()
       this.loadMembership()
       this.loadMembership()