From 7341aa47e19e1920256d604c991dacd5a1f9c40c Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Wed, 24 Aug 2022 11:34:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 9 +++++---- .env.production | 1 + src/views/storeManage/warehouse3D/module/video.vue | 12 +++++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) 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 {