소스 검색

为未获取到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({