Browse Source

fix: index.html加载微信jsd出错

John-Hong 2 years ago
parent
commit
81c17b170b
3 changed files with 3 additions and 2 deletions
  1. 1 1
      public/index.html
  2. 1 1
      src/plugins/install.js
  3. 1 0
      src/utils/login.js

+ 1 - 1
public/index.html

@@ -40,7 +40,7 @@
   <div id="app"></div>
   <!-- built files will be auto injected -->
 </body>
-<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
+<!-- <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> -->
 
 </html>
 <script>

+ 1 - 1
src/plugins/install.js

@@ -43,7 +43,7 @@ Vue.prototype.$userName = 'sys_miniprogram';
 // #endif
 
 // #ifdef H5
-// Vue.prototype.$wx = wx;
+Vue.prototype.$wx = wx;
 Vue.prototype.$authorizeH5 = authorizeH5;
 Vue.prototype.$getCode = getCode;
 Vue.prototype.$postCode = postCode;

+ 1 - 0
src/utils/login.js

@@ -1,5 +1,6 @@
 // import { ApiResponse, get, post } from './request';
 // import { get,post } from '@/utils/request-kip.js'
+import wx from './js_sdk/weixin';
 import request from '@/utils/request-kip.js'
 const get = request.get
 const post = request.post