许成详 6 lat temu
rodzic
commit
09ecdab556
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 2
    2
      config/index.js
  2. 2
    2
      src/util/ajax.js

+ 2
- 2
config/index.js Wyświetl plik

12
     proxyTable: {
12
     proxyTable: {
13
       '/api': {
13
       '/api': {
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
15
-        // target: 'http://192.168.0.62:8080', //wf
15
+        target: 'http://192.168.0.62:8080', //wf
16
         // target: 'http://localhost:8080', 
16
         // target: 'http://localhost:8080', 
17
-        target: 'http://192.168.0.11', //ys
17
+        // target: 'http://192.168.0.11', //ys
18
         // target: 'http://192.168.0.11', //ys
18
         // target: 'http://192.168.0.11', //ys
19
         // target: 'http://dev.ycjcjy.com/', //frp
19
         // target: 'http://dev.ycjcjy.com/', //frp
20
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
20
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置

+ 2
- 2
src/util/ajax.js Wyświetl plik

5
 
5
 
6
 const token = function (headers) {
6
 const token = function (headers) {
7
   let JWT
7
   let JWT
8
-  if (headers){
8
+  if (headers) {
9
     localStorage.setItem('JWT', headers.authorization)
9
     localStorage.setItem('JWT', headers.authorization)
10
     JWT = headers.authorization
10
     JWT = headers.authorization
11
   }
11
   }
27
 
27
 
28
 Axios.interceptors.request.use((config) => {
28
 Axios.interceptors.request.use((config) => {
29
   config.headers.authorization = token()
29
   config.headers.authorization = token()
30
-  config.urlData = {...config.urlData, org: 'MQ'}
30
+  config.urlData = { ...config.urlData, org: 'MQ' }
31
   // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
31
   // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
32
   let urlData = qs.stringify(config.urlData)
32
   let urlData = qs.stringify(config.urlData)
33
   let queryData = qs.stringify(config.queryData)
33
   let queryData = qs.stringify(config.queryData)