美文网首页
vue 路由 histroy 模式 微信jssdk 签名错误

vue 路由 histroy 模式 微信jssdk 签名错误

作者: 他大舅啊 | 来源:发表于2019-10-22 14:54 被阅读0次

config:invalid signature ,这个错误一般都是由于 url 传递不正确导致的

在 beforeRouteEnter 做操作

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

相关文章

网友评论

      本文标题:vue 路由 histroy 模式 微信jssdk 签名错误

      本文链接:https://www.haomeiwen.com/subject/otpqvctx.html