linwenxin hace 1 semana
padre
commit
82f973d07a
Se han modificado 2 ficheros con 8 adiciones y 8 borrados
  1. 2 2
      src/App.vue
  2. 6 6
      src/common/utils/util.js

+ 2 - 2
src/App.vue

@@ -15,6 +15,8 @@ var getUserValTimeId = null
 import store from '@/store/index.js'
 export default {
   async onLaunch() {
+    this.$setStorage('realAuthUrl', window.location.href.split('#')[0])
+
     api
       .get('/user/user/log', {})
       .then(res => {})
@@ -78,8 +80,6 @@ export default {
       }
     })
 
-    this.$setStorage('realAuthUrl', window.location.href.split('#')[0])
-
     // #ifdef H5
     webLogin().then(async res => {
       redirection()

+ 6 - 6
src/common/utils/util.js

@@ -975,12 +975,12 @@ var jishu = 0
 export const wxConfig = function (configInfo, userInfo, cb) {
   let url = ''
   const systemInfo = uni.getSystemInfoSync()
-  // if (systemInfo.platform === 'ios') {
-  //   // iOS平台
-  //   url = getStorage('realAuthUrl')
-  // } else {
-  url = window.location.href.split('#')[0] //获取到的url是当前页面的域名
-  // }
+  if (systemInfo.platform === 'ios') {
+    // iOS平台
+    url = getStorage('realAuthUrl')
+  } else {
+    url = window.location.href.split('#')[0] //获取到的url是当前页面的域名
+  }
   api
     .post('/user/jsapi/sign', {
       url