Browse Source

为未获取到siteid的情况下 设置一层保险

xiaohaizhao 1 year ago
parent
commit
1c76d9aae8
1 changed files with 10 additions and 1 deletions
  1. 10 1
      pages/index/index.js

+ 10 - 1
pages/index/index.js

@@ -41,7 +41,16 @@ Page({
 			},
 		})
 		getApp().globalData.http.refreshData = this.refreshData.bind(this);
-		vIndate();
+		this.getVIndete();
+	},
+	getVIndete() {
+		if (wx.getStorageSync('siteP').siteid) {
+			vIndate();
+		} else {
+			setTimeout(() => {
+				this.getVIndete();
+			}, 100)
+		}
 	},
 	getAnnunciate() {
 		_Http.basic({