张延森 3 vuotta sitten
vanhempi
commit
0c35ec1cb5
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3
    1
      src/utils/initial.js

+ 3
- 1
src/utils/initial.js Näytä tiedosto

@@ -15,7 +15,9 @@ const jsApiList = [
15 15
 ]
16 16
 
17 17
 function initSDK (url) {
18
-  request(`https://api.h5.njyunzhi.com/mp/jssdk?url=${encodeURIComponent(url)}`).then((res) => {
18
+  fetch(`https://api.h5.njyunzhi.com/mp/jssdk?url=${encodeURIComponent(url)}`)
19
+  .then(res => res.json())
20
+  .then((res) => {
19 21
     window.wx.config({
20 22
       debug: process.env.NODE_ENV === 'development', // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
21 23
       appId: res.appId, // 必填,公众号的唯一标识