浏览代码

token延时处理

master
[caserKing] 5 年前
父节点
当前提交
5ac88560c1
共有 1 个文件被更改,包括 10 次插入4 次删除
  1. +10
    -4
      pages/index/index.js

+ 10
- 4
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()
}
}
},

/*


正在加载...
取消
保存