a1140836302 hace 2 años
padre
commit
1b942c62f2
Se han modificado 2 ficheros con 5 adiciones y 4 borrados
  1. 2 1
      src/utils/request.js
  2. 3 3
      vue.config.js

+ 2 - 1
src/utils/request.js

@@ -2,9 +2,10 @@ import axios from 'axios'
 import { Message } from 'element-ui'
 import store from '@/store'
 import { tansParams } from '@/utils/zk'
+import httpurl from '../../vue.config'
 // create an axios instance
 const service = axios.create({
-  baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
+  baseURL: httpurl.devServer.proxy['/api'].target+'/api', // url = base url + request url
   // withCredentials: true, // send cookies when cross-domain requests
   timeout: 10000 // request timeout
 })

+ 3 - 3
vue.config.js

@@ -21,19 +21,19 @@ module.exports = {
     },
     proxy: {
       '/api': {
-        target: `http://192.168.2.10:8081`,
+        target: `http://192.168.2.10:8080`,
         // target: `http://172.16.12.146:8080`,
         ws: true,
         changeOrigin: true,
       },
       '/ws': {
-         target: `ws://192.168.2.10:8081/ws`,
+         target: `ws://192.168.2.10:8080/ws`,
         // target: `ws://172.16.12.146:8080/ws`,
         ws: true,
         changeOrigin: true,
       },
       '/video':{
-        target: `ws://192.168.2.10:8081/`,
+        target: `ws://192.168.2.10:8080/`,
         // target: `ws://172.16.12.146:8080/ws`,
         ws: true,
         changeOrigin: true,