From 604ab51ae358eae60dc8cc01c98535493f09d0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89?= <814457906@qq.com> Date: Tue, 14 Nov 2023 17:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagesC/addHeartRate/addHeartRate.vue | 11 +++++++++-- pagesC/addPressure/addPressure.vue | 11 ++++++----- pagesC/addsugar/addsugar.vue | 10 ++++++---- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/pagesC/addHeartRate/addHeartRate.vue b/pagesC/addHeartRate/addHeartRate.vue index 55cffde..bbf658b 100644 --- a/pagesC/addHeartRate/addHeartRate.vue +++ b/pagesC/addHeartRate/addHeartRate.vue @@ -31,6 +31,9 @@ import { savehr } from '@/api/examinationapi/add.js' + import { + bound, + } from '@/api/examinationapi/add.js' import { dzsocketurl, dysocketurl @@ -52,7 +55,11 @@ if (res.code == 200) { res.data.forEach(e => { if (e.deviceType == 1) { - this.SOCKETURL = `ws://112.6.122.71:8009/fd/webSocket/${e.sn}` + if (uni.getStorageSync('region') == 1) { + this.SOCKETURL = dzsocketurl + `${e.sn}` + } else if (uni.getStorageSync('region') == 2) { + this.SOCKETURL = dysocketurl + `${e.sn}` + } this.scoket(); } }) @@ -305,4 +312,4 @@ } } } - + \ No newline at end of file diff --git a/pagesC/addPressure/addPressure.vue b/pagesC/addPressure/addPressure.vue index a370a74..136788f 100644 --- a/pagesC/addPressure/addPressure.vue +++ b/pagesC/addPressure/addPressure.vue @@ -75,15 +75,16 @@ if (res.code == 200) { res.data.forEach(e => { if (e.deviceType == 1) { - this.SOCKETURL = `ws://112.6.122.71:8009/fd/webSocket/${e.sn}` + if (uni.getStorageSync('region') == 1) { + this.SOCKETURL = dzsocketurl + `${e.sn}` + } else if (uni.getStorageSync('region') == 2) { + this.SOCKETURL = dysocketurl + `${e.sn}` + } this.scoket(); - // 德州的用:ws://112.6.122.71:8009/fd/webSocket/{sn} - // 东营的用:ws://218.58.213.15:8009/fd/webSocket/{sn} } }) } }) - }, methods: { formatDate(timestamp) { @@ -330,4 +331,4 @@ } } } - + \ No newline at end of file diff --git a/pagesC/addsugar/addsugar.vue b/pagesC/addsugar/addsugar.vue index 8d23565..120e6ac 100644 --- a/pagesC/addsugar/addsugar.vue +++ b/pagesC/addsugar/addsugar.vue @@ -63,8 +63,6 @@ timeoutObj: null, socketOpen: false, SOCKETURL: '', - // 德州的用:ws://112.6.122.71:8009/fd/webSocket/{sn} - // 东营的用:ws://218.58.213.15:8009/fd/webSocket/{sn} }; }, onLoad(options) { @@ -72,7 +70,11 @@ if (res.code == 200) { res.data.forEach(e => { if (e.deviceType == 2) { - this.SOCKETURL = `ws://112.6.122.71:8009/fd/webSocket/${e.sn}` + if (uni.getStorageSync('region') == 1) { + this.SOCKETURL = dzsocketurl + `${e.sn}` + } else if (uni.getStorageSync('region') == 2) { + this.SOCKETURL = dysocketurl + `${e.sn}` + } this.scoket(); } }) @@ -322,4 +324,4 @@ } } } - + \ No newline at end of file