李志伟 3 years ago
parent
commit
390d307034
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      src/utils/initial.js

+ 2
- 3
src/utils/initial.js View File

1
-
1
+import request from './request'
2
 import { LoginUser, pv } from './api'
2
 import { LoginUser, pv } from './api'
3
 
3
 
4
 import store from '../store'
4
 import store from '../store'
15
 ]
15
 ]
16
 
16
 
17
 function initSDK (url) {
17
 function initSDK (url) {
18
-  fetch(`https://api.h5.njyunzhi.com/mp/jssdk?url=${encodeURIComponent(url)}`)
19
-  .then(res => res.json())
18
+  request(`/api/wx/jssdk?url=${encodeURIComponent(url)}`)
20
   .then((res) => {
19
   .then((res) => {
21
     window.wx.config({
20
     window.wx.config({
22
       debug: process.env.NODE_ENV === 'development', // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
21
       debug: process.env.NODE_ENV === 'development', // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。