项目中,H5公众号授权我是让进入首页判断是否授权,没授权跳转授权进行授权完成在进入首页,安卓端授权完成,用户物理返回正常,没问题,IOS授权完之后返回结果不走接口了...
所以想到的办法就是手机禁止物理返回,那么安排下
原生方法
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
history.pushState(null, null, document.URL);
});在vue中,我们只需要写在mounted里即可
mounted() {
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
history.pushState(null, null, document.URL);
});
},本文链接:https://my.lmcjl.com/post/20142.html
展开阅读全文
4 评论