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