From 5808f76456ca0d40de5074f132b73a5a488e3e13 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 09 Dec 2025 09:12:03 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v9.0/9.0.1' into test

---
 src/views/device/components/use-device-setting.js |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/views/device/components/use-device-setting.js b/src/views/device/components/use-device-setting.js
index b767d76..a57cc92 100644
--- a/src/views/device/components/use-device-setting.js
+++ b/src/views/device/components/use-device-setting.js
@@ -1,12 +1,13 @@
 import { ElMessage } from 'element-plus';
 
-import { putDeviceProps, putDevicePropsNew } from '@/api/device-setting';
+import { putDeviceProps } from '@/api/device-setting';
 import {
   DeviceSettingKeyEnum,
   ObstacleAvoidanceStatusEnum,
   NightLightsStateEnum,
   DistanceLimitStatusEnum,
 } from '@/types/device-setting';
+import { messages } from '@/lang';
 
 export function useDeviceSetting() {
   // 生成参数
@@ -49,18 +50,17 @@
   }
 
   // 设置设备属性
-  async function setDeviceProps(sn, body, workspaceId) {
+  async function setDeviceProps(sn, workspaceId, body) {
     try {
-      const { code, message: msg } = await putDevicePropsNew(sn, body, workspaceId);
-      if (code === 0) {
-        return true;
-      }
-      throw msg;
-    } catch (e) {
-      ElMessage({
-        message: '设备属性设置失败',
-        type: 'error',
+       await putDeviceProps(sn, workspaceId, body).then(res => {
+         if (res.data.code === 0) {
+           ElMessage({
+             message: '设备属性设置成功!',
+             type: 'success',
+           });
+         }
       });
+    } catch (e) {
       return false;
     }
   }

--
Gitblit v1.9.3