From c54bbda60f81f1665e292fd6d12b3e20af2e1f04 Mon Sep 17 00:00:00 2001 From: PandaX <18610165312@163.com> Date: Fri, 24 Nov 2023 13:18:25 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E6=9C=AA=E8=AE=BE=E7=BD=AE=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=86=85=E5=AE=B9=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/device/api/device.go | 1 + apps/device/api/device_cmd.go | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/device/api/device.go b/apps/device/api/device.go index 5dd5fb9..bb5f102 100644 --- a/apps/device/api/device.go +++ b/apps/device/api/device.go @@ -175,6 +175,7 @@ func (p *DeviceApi) DownAttribute(rc *restfulx.ReqCtx) { id := restfulx.PathParam(rc, "id") key := restfulx.QueryParam(rc, "key") value := restfulx.QueryParam(rc, "value") + biz.NotEmpty(value, "请设置属性值") err := util.BuildRunDeviceRpc(id, "single", map[string]interface{}{ "method": "setAttributes", "params": map[string]interface{}{ diff --git a/apps/device/api/device_cmd.go b/apps/device/api/device_cmd.go index 321d21b..d0f46da 100644 --- a/apps/device/api/device_cmd.go +++ b/apps/device/api/device_cmd.go @@ -44,6 +44,7 @@ func (p *DeviceCmdLogApi) GetDeviceCmdLogList(rc *restfulx.ReqCtx) { func (p *DeviceCmdLogApi) InsertDeviceCmdLog(rc *restfulx.ReqCtx) { var data entity.DeviceCmdLog restfulx.BindJsonAndValid(rc, &data) + biz.NotEmpty(data.CmdContent, "请设置指令内容") //验证指令格式 ms := make(map[string]interface{}) err := json.Unmarshal([]byte(data.CmdContent), &ms)