From 5ac88560c15602250c78bd24f6840d83621de6e0 Mon Sep 17 00:00:00 2001 From: "[caserKing]" <[wkx12138@126.com]> Date: Sat, 15 Aug 2020 09:47:35 +0800 Subject: [PATCH] =?UTF-8?q?token=E5=BB=B6=E6=97=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index 5ecfdf0..0516067 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -56,11 +56,17 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - setTimeout(() => { //延时300ms 否则 拿不到token%3..x + if (app.globalData.token) { this.getBannerlist() - console.log(123) - }, 300) - this.gitSquareLis() + this.gitSquareLis() + } else { + app.tokenCallback = token => { + this.getBannerlist() + this.gitSquareLis() + } + } + + }, /*