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() } }

 

相关文章:

  • 2021-07-12
  • 2021-06-25
  • 2021-06-10
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-11-21
  • 2021-07-04
  • 2022-12-23
  • 2021-07-30
  • 2021-12-12
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案