From 15a7706e1ec262ce5e76070cdbd872a1b29d30ba Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 6 Jun 2024 08:34:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AE=A1=E7=90=86=E7=AB=AFto?= =?UTF-8?q?kenKey=20ws=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/auth.js | 2 +- ruoyi-ui/src/views/index.vue | 4 ++-- ruoyi-ui/src/views/websocket.vue | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/utils/auth.js b/ruoyi-ui/src/utils/auth.js index 234a0a7a..6258738c 100644 --- a/ruoyi-ui/src/utils/auth.js +++ b/ruoyi-ui/src/utils/auth.js @@ -1,6 +1,6 @@ import Cookies from 'js-cookie' -const TokenKey = 'DC-Token' +const TokenKey = 'DC-Pro-Token' export function getToken() { return Cookies.get(TokenKey) diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index c2b177e9..fd0206b9 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -701,7 +701,7 @@ export default { /************************************ 设备消息 **************************************/ /** 时间按钮选项 */ timeDimensionChange() { - if (this.messageMonitorTimeDimension === 'day') { + /*if (this.messageMonitorTimeDimension === 'day') { this.messageMonitorTimePick = this.getTodayTime() const params = { time: '1h', @@ -763,7 +763,7 @@ export default { this.getMessageMonitorData(params, 'received_message') this.getMessageMonitorData(params, 'sent_message') - } + }*/ }, /** 设备消息char初始化 */ diff --git a/ruoyi-ui/src/views/websocket.vue b/ruoyi-ui/src/views/websocket.vue index 3c7c4979..783d9c16 100644 --- a/ruoyi-ui/src/views/websocket.vue +++ b/ruoyi-ui/src/views/websocket.vue @@ -19,7 +19,8 @@ export default { websocket({ password, path, port, interval}) { // 建立 websocket 连接 this.socket.initialize({ - url: 'ws://' + location.hostname + ':' + port + path, + // url: 'ws://' + location.hostname + ':' + port + path, + url: 'wss://' + location.hostname + ':' + window.location.port + '/ws' || 80 + '/ws', password: password, tokenSN: this.token, heartRate: interval