Browse Source

Merge branch '20230223_pad_vue_new_branch' of http://git.shengws.com/csx/Pad_New into 20230223_pad_vue_new_branch

28169 1 week ago
parent
commit
c0574ec669
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/utils/request.js

+ 7 - 1
src/utils/request.js View File

@@ -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;