Browse Source

test: 删除测试代码

zhengxy 1 year ago
parent
commit
82f74e2e78
3 changed files with 3 additions and 43 deletions
  1. 2 2
      qwh5/public/index.html
  2. 0 30
      qwh5/src/App.vue
  3. 1 11
      qwh5/src/views/extend.vue

+ 2 - 2
qwh5/public/index.html

@@ -8,8 +8,8 @@
8 8
       <meta http-equiv="pragram" content="no-cache">
9 9
       <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
10 10
       <meta http-equiv="Cache" content="no-cache">
11
-      <!-- <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
12
-      <!-- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> -->
11
+      <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
12
+      <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
13 13
 
14 14
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
15 15
 <!--    <title><%= htmlWebpackPlugin.options.title %></title>-->

+ 0 - 30
qwh5/src/App.vue

@@ -2,36 +2,6 @@
2 2
   <router-view />
3 3
 </template>
4 4
 
5
-<script lang="ts" setup>
6
-import { onErrorCaptured } from "vue";
7
-import { getQueryString } from '@/utils/common'
8
-import $axios from '@/utils/axios'
9
-
10
-const handleWarnReport = async (step, errMsg?) => {
11
-  try {
12
-    const _originalLink = localStorage.getItem('_originalLink') || ''
13
-    const linkInfo = {
14
-      url: window.location.href,
15
-      originalLink: _originalLink,
16
-      errMsg: errMsg,
17
-    }
18
-    const url = '/api/oauth2/warnReport'
19
-    const params = {
20
-      step,
21
-      corpid: getQueryString('corpid') || '0',
22
-      link: JSON.stringify(linkInfo),
23
-    }
24
-    await $axios.get(url, {...params})
25
-  } catch (error) {
26
-    console.log('error =>', error)
27
-  }
28
-}
29
-
30
-onErrorCaptured((err) => {
31
-  handleWarnReport(8, err.message)
32
-})
33
-</script>
34
-
35 5
 <style>
36 6
 #app {
37 7
   font-family: Avenir, Helvetica, Arial, sans-serif;

+ 1 - 11
qwh5/src/views/extend.vue

@@ -3,7 +3,7 @@
3 3
 </template>
4 4
 <script lang="ts" setup>
5 5
 import { getQueryString } from '@/utils/common'
6
-import { ref, onBeforeMount, onErrorCaptured } from "vue";
6
+import { onBeforeMount } from "vue";
7 7
 import { Toast } from 'vant';
8 8
 import $axios from '@/utils/axios'
9 9
 
@@ -36,8 +36,6 @@ const setOriginalLink = () => {
36 36
 // [ 5, '链接无jumpLink参数' ],
37 37
 // [ 6, '跳转企微授权' ],
38 38
 // [ 7, '跳转第三方链接' ],
39
-// [ 8, 'App.vue onErrorCaptured' ],
40
-// [ 9, 'ww27823a3b2285bd5d 上报' ],
41 39
 
42 40
 const handleWarnReport = async (step, errMsg?) => {
43 41
   try {
@@ -59,10 +57,6 @@ const handleWarnReport = async (step, errMsg?) => {
59 57
   }
60 58
 }
61 59
 
62
-onErrorCaptured((err) => {
63
-  handleWarnReport(8, err.message)
64
-})
65
-
66 60
 onBeforeMount(() => {//组件挂载之前
67 61
   setOriginalLink()
68 62
 
@@ -75,10 +69,6 @@ onBeforeMount(() => {//组件挂载之前
75 69
       handleWarnReport(1)
76 70
     }
77 71
 
78
-    if (getQueryString('corpid') === 'ww27823a3b2285bd5d') {
79
-      handleWarnReport(9)
80
-    }
81
-
82 72
     try {
83 73
       let redirect_uri = encodeURIComponent(window.location.href + '&againJump=true')
84 74
       let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${getQueryString('corpid')}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=1&agentid=1000012#wechat_redirect`;