微信js-sdk config在安卓系统下正常,ios系统却报'invalid signature'

IOS:微信IOS版,每次切换路由,SPA的url是不会变的,发起签名请求的url参数必须是当前页面的url就是最初进入页面时的url

Android:微信安卓版,每次切换路由,SPA的url是会变的,发起签名请求的url参数必须是当前页面的url(不是最初进入页面时的)

vue 中,和data平级

beforeRouteEnter (to, from, next) {
var u = navigator.userAgent; var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 // XXX: 修复iOS版微信HTML5 History兼容性问题 if (isiOS && to.path !== location.pathname) { // 此处不可使用location.replace location.assign(to.fullPath) } else { next() } }

猜你喜欢

转载自www.cnblogs.com/songxuan/p/10826335.html
今日推荐