From b87fc6206ba7f5257f54e255f5b3ff73a477e23e Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 02 Sep 2025 09:36:13 +0800
Subject: [PATCH] Merge branch 'feature/v5.0/5.0.5' into test
---
src/views/device/components/use-device-setting.js | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/views/device/components/use-device-setting.js b/src/views/device/components/use-device-setting.js
index ede8603..258c6bf 100644
--- a/src/views/device/components/use-device-setting.js
+++ b/src/views/device/components/use-device-setting.js
@@ -7,6 +7,7 @@
NightLightsStateEnum,
DistanceLimitStatusEnum,
} from '@/types/device-setting';
+import { messages } from '@/lang';
export function useDeviceSetting() {
// 生成参数
@@ -51,16 +52,15 @@
// 设置设备属性
async function setDeviceProps(sn, body) {
try {
- const { code, message: msg } = await putDeviceProps(sn, body);
- if (code === 0) {
- return true;
- }
- throw msg;
- } catch (e) {
- ElMessage({
- message: '设备属性设置失败',
- type: 'error',
+ await putDeviceProps(sn, body).then(res => {
+ if (res.data.code === 0) {
+ ElMessage({
+ message: '设备属性设置成功!',
+ type: 'success',
+ });
+ }
});
+ } catch (e) {
return false;
}
}
--
Gitblit v1.9.3