Vue微信公眾號jssdk ios config配置fail問題


注冊兩年多,第一次寫。。。記一下前幾天項目遇到的問題吧。

Vue history模式下 ios手機config:fail,刷新一下才可以。既然安卓沒問題,那就沒必要去一步步驗證,問題就在ios。最直接的方法:

router.afterEach((to, from)=>{
let u = navigator.userAgent;
if (u.indexOf("iPhone") > -1 || u.indexOf("iOS") > -1) {
if (window.configUrl == '' || window.configUrl == undefined) {
window.configUrl = 'http://weixin.xxxxxx.com' + to.fullPath;
}
}else{
window.configUrl = 'http://weixin.xxxxxx.com' + to.fullPath;
}
})
在需要使用jssdk頁面,用全局的window.configUrl來獲取配置信息。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM