1.在小程序onLaunch生命周期函数中获取全局用户信息,打印该信息:

3.完整代码:

App({   onLaunch: function() {    var user = wx.getStorageInfoSync("userInfo");    console.log(user)    if (user.keys.length0) {      wx.switchTab({        url: 'pages/index/index/index',      })    } else {      wx.redirectTo({        url: 'pages/splash/splash',      })    }  },})

4.其他类似需求,可根据自己放到本地缓存中的值,进行相应判断实现跳转。

TAG标签: 微信小程序小米8闪屏

http://www.xiaochengxub.com/read-105601.html