Browse Source

环境隔离

John-Hong 2 years ago
parent
commit
3f9a040aab
1 changed files with 2 additions and 1 deletions
  1. 2 1
      public/index.html

+ 2 - 1
public/index.html

@@ -45,7 +45,8 @@
 </html>
 <script>
   // const debug = window.localStorage.getItem('H5_DEBUG');
-  const debug = true;
+  // 开发环境和qa环境 打开debug
+  const debug = /dev-|qa-/.test(window?.injectConfig?.api) || window.location.href.indexOf(8080) > -1;
   if (debug) {
     const script = document.createElement('script');
     script.src = 'https://unpkg.com/vconsole@latest/dist/vconsole.min.js';