From 2ca94de8ede18ac07ccfd8dec7b6f6a707adde9b Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Mon, 01 Sep 2025 11:20:24 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v5.0/5.0.5' into patch_management
---
src/views/device/components/use-dock-control.js | 42 +++++++++++++++++-------------------------
1 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/src/views/device/components/use-dock-control.js b/src/views/device/components/use-dock-control.js
index bd62a21..546a2fb 100644
--- a/src/views/device/components/use-dock-control.js
+++ b/src/views/device/components/use-dock-control.js
@@ -24,41 +24,33 @@
// 发送指令
async function sendDockControlCmd(params, tip = true) {
- try {
- let body = undefined;
- if (params.action !== undefined) {
- if (params.cmd === DeviceCmd.SdrWorkModeSwitch) {
- body = {
- link_workmode: params.action,
- };
- } else {
- body = {
- action: params.action,
- };
- }
+ let body = undefined;
+ if (params.action !== undefined) {
+ if (params.cmd === DeviceCmd.SdrWorkModeSwitch) {
+ body = {
+ link_workmode: params.action,
+ };
+ } else {
+ body = {
+ action: params.action,
+ };
}
- const { code, message: msg } = await postSendCmd(
- { dock_sn: params.sn, device_cmd: params.cmd },
- body
- );
- if (code === 0) {
+ }
+ try {
+ const res = await postSendCmd({ dock_sn: params.sn, device_cmd: params.cmd }, body);
+ if (res.data.code === 0) {
tip &&
ElMessage({
message: '指令发送成功',
type: 'success',
});
return true;
- message.error('指令发送失败');
}
- throw msg;
- } catch (e) {
- tip &&
- ElMessage({
- message: '指令发送失败',
- type: 'error',
- });
+ } catch (error) {
return false;
}
+
+ return false;
}
// 控制面板关闭
--
Gitblit v1.9.3