This commit is contained in:
2023-11-14 17:21:47 +08:00
parent 02f675c30c
commit 604ab51ae3
3 changed files with 21 additions and 11 deletions

View File

@ -31,6 +31,9 @@
import { import {
savehr savehr
} from '@/api/examinationapi/add.js' } from '@/api/examinationapi/add.js'
import {
bound,
} from '@/api/examinationapi/add.js'
import { import {
dzsocketurl, dzsocketurl,
dysocketurl dysocketurl
@ -52,7 +55,11 @@
if (res.code == 200) { if (res.code == 200) {
res.data.forEach(e => { res.data.forEach(e => {
if (e.deviceType == 1) { 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(); this.scoket();
} }
}) })
@ -305,4 +312,4 @@
} }
} }
} }
</style> </style>

View File

@ -75,15 +75,16 @@
if (res.code == 200) { if (res.code == 200) {
res.data.forEach(e => { res.data.forEach(e => {
if (e.deviceType == 1) { 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(); this.scoket();
// ws://112.6.122.71:8009/fd/webSocket/{sn}
// ws://218.58.213.15:8009/fd/webSocket/{sn}
} }
}) })
} }
}) })
}, },
methods: { methods: {
formatDate(timestamp) { formatDate(timestamp) {
@ -330,4 +331,4 @@
} }
} }
} }
</style> </style>

View File

@ -63,8 +63,6 @@
timeoutObj: null, timeoutObj: null,
socketOpen: false, socketOpen: false,
SOCKETURL: '', SOCKETURL: '',
// ws://112.6.122.71:8009/fd/webSocket/{sn}
// ws://218.58.213.15:8009/fd/webSocket/{sn}
}; };
}, },
onLoad(options) { onLoad(options) {
@ -72,7 +70,11 @@
if (res.code == 200) { if (res.code == 200) {
res.data.forEach(e => { res.data.forEach(e => {
if (e.deviceType == 2) { 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(); this.scoket();
} }
}) })
@ -322,4 +324,4 @@
} }
} }
} }
</style> </style>