sunjh 6 éve
szülő
commit
a5a3a32d96
1 módosított fájl, 11 hozzáadás és 0 törlés
  1. 11 0
      src/components/Home.vue

+ 11 - 0
src/components/Home.vue

@@ -97,6 +97,7 @@ export default {
     },
     //加载数据
     loadData: function () {
+      this.showLoading()
       console.log('loadData')
       Http.get(Apis.PAGE.HOME_PAGE).then((res) => {
         console.log(res)
@@ -104,12 +105,22 @@ export default {
         this.institutionRank = res.agencyRank
         this.personRank = res.userRank
         this.imgList = res.imgList
+        this.hideLoading()
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '主页加载失败:' + error.data)
       })
     },
     setUserInfo () {
       this.user = storageGet('user')
       this.rolesPermissions = storageGet('rolesPermissions')
     },
+    showLoading () {
+      this.loading = true
+    },
+    hideLoading () {
+      this.loading = false
+    }
   },
   created: function () {
     //notify('info', 'info')