小程序用户登录过期操作
timeOut: function () { var that = this; setInterval(function () { that.request('', {}, 'GET', function (res) { if (!res.data.data) { wx.showToast({ title: '用户未登录或已过期,请重新登录!', icon: 'none', duration: 3000, mask: false, success: function () { wx.removeStorageSync('token'); wx.removeStorageSync('userName'); wx.removeStorageSync('userPassword'); setTimeout(function () { wx.navigateTo({ url: '', }) }, 2000) }, }) } }, function () { console.log("失败") } ); }, 300000); },
此时此刻 你只需要把这段代码放进你的app。js 中 换上你的接口 就好了 wx.removeStorageSync 删除登录的存储信息
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

