Browse Source

getWxConfig优化

xiuli.gao 2 years ago
parent
commit
4bd80f46b8

File diff suppressed because it is too large
+ 1 - 1
qwh5/dist/index.html


File diff suppressed because it is too large
+ 1 - 0
qwh5/dist/js/app.62bd5cc7.js


File diff suppressed because it is too large
+ 0 - 1
qwh5/dist/js/app.950a091e.js


File diff suppressed because it is too large
+ 1 - 1
qwh5/dist/js/userPortrait.b861ab26.js


+ 20 - 20
qwh5/src/utils/getWxConfig.ts

@@ -9,26 +9,26 @@ import { setLocal, getLocal } from './storage'
9 9
  */
10 10
 function getAuthInfo(cb?: any, redirect_url?: any) {
11 11
   //回跳回来后,拿到本地存储的信息去走授权
12
-  if (getLocal('authInfo') && getQueryString('againJump')) {
13
-    const local_auth_info: string = getLocal('authInfo') || null;
14
-    initEvent(JSON.parse(local_auth_info), cb)
15
-  } else {
16
-    axios.post('/api/h5/auth/commonAuthData', {
17
-      corpid: getQueryString('corpid'),
18
-      url: location.href.split('#')[0],
19
-    }).then((res: any) => {
20
-      //构造网页授权链接回调 保存返回信息
21
-      if (redirect_url) {
22
-        setLocal('authInfo', JSON.stringify(res.rst))
23
-        redirect_url(res.rst)
24
-      }
25
-      if (cb) {
26
-        initEvent(res.rst, cb)
27
-      }
28
-    }).catch((err) => {
29
-      console.log(err, 'err')
30
-    })
31
-  }
12
+  // if (getLocal('authInfo') && getQueryString('againJump')) {
13
+  //   const local_auth_info: string = getLocal('authInfo') || null;
14
+  //   initEvent(JSON.parse(local_auth_info), cb)
15
+  // } else {
16
+  axios.post('/api/h5/auth/commonAuthData', {
17
+    corpid: getQueryString('corpid'),
18
+    url: location.href.split('#')[0],
19
+  }).then((res: any) => {
20
+    //构造网页授权链接回调 保存返回信息
21
+    if (redirect_url) {
22
+      // setLocal('authInfo', JSON.stringify(res.rst))
23
+      redirect_url(res.rst)
24
+    }
25
+    if (cb) {
26
+      initEvent(res.rst, cb)
27
+    }
28
+  }).catch((err) => {
29
+    console.log(err, 'err')
30
+  })
31
+  // }
32 32
 }
33 33
 
34 34
 function initEvent(authInfo: any, cb) {