无人机管理后台前端(已迁走)
zhongrj
2025-01-03 02f33eccc268c7daac8ab561044f32859d8864de
src/views/device/components/use-dock-control.js
@@ -24,7 +24,6 @@
  // 发送指令
  async function sendDockControlCmd(params, tip = true) {
    try {
      let body = undefined;
      if (params.action !== undefined) {
        if (params.cmd === DeviceCmd.SdrWorkModeSwitch) {
@@ -37,28 +36,21 @@
          };
        }
      }
      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;
  }
  // 控制面板关闭