Explorar o código

feat(KIP-6765): KERRY+小程序临停缴费功能未登录身份使用流程

John-Hong %!s(int64=2) %!d(string=hai) anos
pai
achega
a674e5d26b
Modificáronse 2 ficheiros con 5 adicións e 1 borrados
  1. 2 0
      src/App.vue
  2. 3 1
      src/utils/login.js

+ 2 - 0
src/App.vue

@@ -118,6 +118,8 @@ export default {
       }
       // 如果是微信公众号
       if (getIsWxh5() || true) {
+        // https://developers.weixin.qq.com/community/develop/doc/000ae2cb950808f90d8bc415551800
+        window.H5_LAUNCH_URL = location.href;
         // 判断用户是否登录
         this.micromessengerInit();
       }

+ 3 - 1
src/utils/login.js

@@ -215,7 +215,9 @@ function WxJsSdkSignature(param) {
 export async function initWxJsSdkConfig(jsApiList = [], openTagList = []) {
   let url = location.href;
   // https://developers.weixin.qq.com/community/develop/doc/000ae2cb950808f90d8bc415551800
-  if (getMobileOperatingSystem() === 'iOS' && window.H5_LAUNCH_URL) {
+  //2. 判断是否为ios 如果为ios且有缓存url 则不做处理
+  const isIOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent);
+  if (isIOS && window.H5_LAUNCH_URL) {
     url = window.H5_LAUNCH_URL;
   }
   // url = url.replace(/http(s)?:\/\//g, '');