张延森 3 年前
父节点
当前提交
0c35ec1cb5
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      src/utils/initial.js

+ 3
- 1
src/utils/initial.js 查看文件

@@ -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, // 必填,公众号的唯一标识