微信小程序引导页、闪屏页、登录页只显示一次的实现方法
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.其他类似需求,可根据自己放到本地缓存中的值,进行相应判断实现跳转。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

