diff --git a/.env.development b/.env.development index 8770ba2..338adc0 100644 --- a/.env.development +++ b/.env.development @@ -3,16 +3,17 @@ ENV = 'development' # 接口地址 #内网服务地址 -#VUE_APP_BASE_API = 'http://192.168.99.207:7070' -#VUE_APP_WS_API = 'ws://192.168.99.207:7071' +VUE_APP_BASE_API = 'http://192.168.99.207:7070' +VUE_APP_WS_API = 'ws://192.168.99.207:7071' +CAMERA_APP_BASE_API = '192.168.99.207' # 刘力-本地服地址 #VUE_APP_BASE_API = 'http://192.168.99.65:7070' #VUE_APP_WS_API = 'ws://192.168.99.65:7071' # 许镇-本地服地址 -VUE_APP_BASE_API = 'http://192.168.99.84:7070' -VUE_APP_WS_API = 'ws://192.168.99.84:7070' +#VUE_APP_BASE_API = 'http://192.168.99.84:7070' +#VUE_APP_WS_API = 'ws://192.168.99.84:7070' # 是否启用 babel-plugin-dynamic-import-node插件 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index 84a66f7..21a47ec 100644 --- a/.env.production +++ b/.env.production @@ -5,3 +5,4 @@ ENV = 'production' VUE_APP_BASE_API = 'http://192.168.99.207:7070' # 如果接口是 http 形式, wss 需要改为 ws VUE_APP_WS_API = 'ws://192.168.99.207:7071' +CAMERA_APP_BASE_API = '192.168.99.207' diff --git a/src/views/storeManage/warehouse3D/module/video.vue b/src/views/storeManage/warehouse3D/module/video.vue index fb0fe6f..dc0a49d 100644 --- a/src/views/storeManage/warehouse3D/module/video.vue +++ b/src/views/storeManage/warehouse3D/module/video.vue @@ -57,7 +57,8 @@ export default { // this.myVideo.pause() // $.post('http://127.0.0.1:3000/cameras/close/', { rtspUrl: $('#rtsp').val() }, function(result) { const data = { rtspUrl: this.rtspUrl } - axios.post('http://127.0.0.1:3000/cameras/close/', qs.stringify(data), + const Uri = 'http://' + process.env.CAMERA_APP_BASE_API + ':3000/cameras/close/' + axios.post(Uri, qs.stringify(data), { headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' @@ -75,7 +76,8 @@ export default { }, play() { const data = { rtspUrl: this.rtspUrl, size: '1024*768' } - axios.post('http://127.0.0.1:3000/cameras/', qs.stringify(data), + const Uri = 'http://' + process.env.CAMERA_APP_BASE_API + ':3000/cameras/' + axios.post(Uri, qs.stringify(data), { headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' @@ -83,7 +85,7 @@ export default { } ).then(res => { // res.data.port - const url = 'ws://127.0.0.1:' + res.data.port + const url = 'ws://' + process.env.CAMERA_APP_BASE_API + ':' + res.data.port // var canvas = document.getElementById('canvas') const opt = { contianer: this.$refs['canvas-wrap'], @@ -107,5 +109,9 @@ export default {