Browse Source

将jQuery放在本地

jwyu 2 years ago
parent
commit
21db6caaf6
3 changed files with 12 additions and 5 deletions
  1. 1 1
      index.html
  2. 1 0
      public/jquery-3.6.0.min.js
  3. 10 4
      src/views/hzyb/utils/reportErr.js

+ 1 - 1
index.html

@@ -5,7 +5,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
     <title>弘则研究</title>
     <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
-    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
+    <script src="/jquery-3.6.0.min.js"></script>
   </head>
   <body>
     <div id="app"></div>

File diff suppressed because it is too large
+ 1 - 0
public/jquery-3.6.0.min.js


+ 10 - 4
src/views/hzyb/utils/reportErr.js

@@ -5,19 +5,25 @@ const reportErr=(app)=>{
     let errObj={}
 
     app.config.errorHandler=(err, instance, info)=>{
+        console.error(err)
         errObj={
             msg:err.message,
             stack:err.stack
         }
-        apiReportingErrInfo({errInfo:errObj})
+        if(import.meta.env.MODE==='production'){
+            apiReportingErrInfo({errInfo:errObj})
+        }
     }
 
     window.addEventListener('error',(e)=>{
+        console.error(e)
         errObj={
-            msg:e.error.message,
-            stack:e.error.stack
+            msg:e.error?.message,
+            stack:e.error?.stack
+        }
+        if(import.meta.env.MODE==='production'){
+            apiReportingErrInfo({errInfo:errObj})
         }
-        apiReportingErrInfo({errInfo:errObj})
     })
 }
 

Some files were not shown because too many files changed in this diff