From e812e1d4f449028d361b7bdfb8c1c85b24ce2d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Thu, 15 May 2025 08:50:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BF=80=E5=85=89=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FatigueWakesUp/components/DeviceParam.vue | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue index 30081ddc..48d7dfe5 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue @@ -287,17 +287,34 @@ export default { // } }, async requestURL(functionId, options = {}) { - let result = await request({ - url: `/business/device/functions/${this.deviceId}/${functionId}`, - method: "post", - data: options, - }); - console.log("工作模式") - console.log(result) - if (result.code != 200) return Message.error(result?.msg); - //模式设定:SETMD;模式查询:ASKMD;时间设定:SETTM;时间查询:ASKTM;自定义设置:SETDF;自定义查询:ASKDF - return result; + + const url = `/business/device/functions/${this.deviceId}/${functionId}`; + if (!this.deviceId) { + throw new Error("设备ID为空,无法发送请求"); + } + let result = await request({ + url, + method: "post", + data: options, + headers: { + 'Content-Type': 'application/json', + // 'Authorization': 'Bearer ' + getToken() + } + }); + + console.log("完整响应:", result); + console.log("JSON:", JSON.stringify(result)); + + if (!result || result.code !== 200) { + Message.error(result?.msg || "请求失败"); + return null; + } + + return result; + + }, + async tabClick() { if (this.activeName == "second") { if (this.isMultiControl)