浏览代码

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

xiaohaizhao 1 年之前
父节点
当前提交
1c76d9aae8
共有 1 个文件被更改,包括 10 次插入1 次删除
  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({