陈少旭 hace 2 meses
padre
commit
5ff47213f1
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      src/utils/request.js

+ 7 - 1
src/utils/request.js Ver fichero

@@ -1,15 +1,21 @@
1 1
 import axios from "axios";
2 2
 // import { Toast } from 'mint-ui'
3 3
 import { Toast } from "vant";
4
+const https = require('https');
5
+
4 6
 
5 7
 import context from '../../src/main.js'
6 8
 
9
+const agent = new https.Agent({
10
+  rejectUnauthorized: false  // 忽略证书验证
11
+});
7 12
 
8 13
 // create an axios instance
9 14
 const service = axios.create({
10 15
   baseURL: process.env.BASE_API, // api的base_url
11 16
   timeout: 30000, // request timeout
12
-  withCredentials: true
17
+  withCredentials: true,
18
+  httpsAgent: agent,
13 19
 });
14 20
 
15 21
 var self = this;