提交: ws 更改设备id 为deviceKey

This commit is contained in:
23688nl 2022-09-28 16:32:01 +08:00
parent 1af91ba9e5
commit 7edd17714d
2 changed files with 4 additions and 4 deletions

View File

@ -404,7 +404,7 @@ export default {
if (!this.list || this.length <= 0) { if (!this.list || this.length <= 0) {
return; return;
} }
let deviceIds = this.list.map((v) => v["deviceId"]); let deviceIds = this.list.map((v) => v["deviceKey"]);
this.stompClient = new WebSocket( this.stompClient = new WebSocket(
`${webSocketProjectGatewayUrl}/${this.getGuid()}/${deviceIds.toString()}` `${webSocketProjectGatewayUrl}/${this.getGuid()}/${deviceIds.toString()}`
); );
@ -424,7 +424,7 @@ export default {
handleDeviceInfo(param) { handleDeviceInfo(param) {
if (this.list && this.list.length > 0) { if (this.list && this.list.length > 0) {
this.list = this.list.map((v) => { this.list = this.list.map((v) => {
if (v["deviceId"] === param["deviceId"]) { if (v["deviceKey"] === param["deviceKey"]) {
return Object.assign(v, param); return Object.assign(v, param);
} else { } else {
return v; return v;

View File

@ -340,7 +340,7 @@ export default {
handleOpenDevStatusService(str) { handleOpenDevStatusService(str) {
console.log("handleOpenDevStatusService", str); console.log("handleOpenDevStatusService", str);
this.wsStatusService = `${webSocketProjectGatewayUrl}/${this.getGuid()}/${ this.wsStatusService = `${webSocketProjectGatewayUrl}/${this.getGuid()}/${
this.deviceInfo.deviceId this.deviceInfo.deviceKey
},${str}`; },${str}`;
}, },
wsMessage(e) { wsMessage(e) {
@ -602,7 +602,7 @@ export default {
}).then((response) => { }).then((response) => {
this.childDeviceList = response.rows; this.childDeviceList = response.rows;
var childDeviceIds = [...response.rows].map((v) => { var childDeviceIds = [...response.rows].map((v) => {
return v.deviceId; return v.deviceKey;
}); });
this.handleOpenDevStatusService(childDeviceIds.toString()); this.handleOpenDevStatusService(childDeviceIds.toString());
}); });