From 959585ce08243c720fa6d17ebc7b193c45784f5c Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Tue, 26 Jul 2022 10:02:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=97=A0=E6=B3=95=E6=AD=A3=E7=A1=AE=E4=BB=A3?= =?UTF-8?q?=E7=90=86websocket=E8=AF=B7=E6=B1=82=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 16bf9411f..7877600bf 100755 --- a/app.js +++ b/app.js @@ -8,6 +8,7 @@ var indexRouter = require('./routes/index'); var usersRouter = require('./routes/users'); const proxy = require('express-http-proxy'); +const {createProxyMiddleware} = require('http-proxy-middleware'); var app = express(); @@ -30,10 +31,13 @@ let opts = { } - app.use('/callComponent', proxy('http://192.168.100.108:8008', opts)); app.use('/app', proxy('http://192.168.100.108:8008', opts)); - +app.use('/ws', createProxyMiddleware({ + target: 'http://192.168.100.108:8008', + changeOrigin: true, + ws: true +})); // app.use('/callComponent', proxy('http://127.0.0.1:8008', opts)); // app.use('/app', proxy('http://127.0.0.1:8008', opts)); @@ -73,4 +77,4 @@ app.use(function(err, req, res, next) { res.render('error'); }); -module.exports = app; \ No newline at end of file +module.exports = app; -- Gitee From 8b1aa5c37b63363832f8087cdc1ca14882171a68 Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Tue, 26 Jul 2022 10:07:40 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=88=A4=E7=A9=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/components/property/indexNotice/indexNotice.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/components/property/indexNotice/indexNotice.js b/public/components/property/indexNotice/indexNotice.js index 8ecf54382..db1e36516 100644 --- a/public/components/property/indexNotice/indexNotice.js +++ b/public/components/property/indexNotice/indexNotice.js @@ -28,7 +28,7 @@ param, function (json, res) { let _res = JSON.parse(json); - + $that.indexNoticeInfo.notices = _res.notices; $that.$nextTick(function() { setInterval($that.checkPoolScroll,2000); @@ -36,13 +36,14 @@ }, function (errInfo, error) { console.log('请求失败处理'); - + } ); }, checkPoolScroll: function() { var element = document.getElementById("pool"); + if(!element)return; var clientHeight = element.clientHeight; var scrollHeight = element.scrollHeight; if(scrollHeight > clientHeight){ @@ -56,6 +57,7 @@ }, poolScroll: function() { var element = document.getElementById("pool"); + if(!element)return; var clientHeight = element.clientHeight; var scrollHeight = element.scrollHeight; var canScrollHeight = scrollHeight - clientHeight; @@ -77,4 +79,4 @@ } } }) -})(window.vc); \ No newline at end of file +})(window.vc); -- Gitee From 9ce17233149ce43bc863ba746b58a1ea5016bdcc Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Tue, 26 Jul 2022 10:09:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=88=A4=E7=A9=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/pages/property/indexContext/indexContext.js | 3 ++- public/pages/property/propertyIndex/propertyIndex.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/pages/property/indexContext/indexContext.js b/public/pages/property/indexContext/indexContext.js index 64b308f5c..65c0a3564 100755 --- a/public/pages/property/indexContext/indexContext.js +++ b/public/pages/property/indexContext/indexContext.js @@ -38,6 +38,7 @@ var indexData = JSON.parse(json); vc.copyObject(indexData, vc.component.indexContextInfo); let _dom = document.getElementById('ownerCount'); + if(!_dom)return; $that._initCharts2(indexData.ownerCount - indexData.noEnterRoomCount, indexData.noEnterRoomCount, _dom, vc.i18n('业主信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('未入住', 'indexContext')); _dom = document.getElementById('roomCount'); $that._initCharts2(indexData.roomCount - indexData.freeRoomCount, indexData.freeRoomCount, _dom, vc.i18n('房屋信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('空闲', 'indexContext')); @@ -158,4 +159,4 @@ } } }) -})(window.vc); \ No newline at end of file +})(window.vc); diff --git a/public/pages/property/propertyIndex/propertyIndex.js b/public/pages/property/propertyIndex/propertyIndex.js index 64b308f5c..65c0a3564 100755 --- a/public/pages/property/propertyIndex/propertyIndex.js +++ b/public/pages/property/propertyIndex/propertyIndex.js @@ -38,6 +38,7 @@ var indexData = JSON.parse(json); vc.copyObject(indexData, vc.component.indexContextInfo); let _dom = document.getElementById('ownerCount'); + if(!_dom)return; $that._initCharts2(indexData.ownerCount - indexData.noEnterRoomCount, indexData.noEnterRoomCount, _dom, vc.i18n('业主信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('未入住', 'indexContext')); _dom = document.getElementById('roomCount'); $that._initCharts2(indexData.roomCount - indexData.freeRoomCount, indexData.freeRoomCount, _dom, vc.i18n('房屋信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('空闲', 'indexContext')); @@ -158,4 +159,4 @@ } } }) -})(window.vc); \ No newline at end of file +})(window.vc); -- Gitee