diff --git a/apps/device/api/device_cmd.go b/apps/device/api/device_cmd.go index d0f46da..77f270c 100644 --- a/apps/device/api/device_cmd.go +++ b/apps/device/api/device_cmd.go @@ -49,6 +49,7 @@ func (p *DeviceCmdLogApi) InsertDeviceCmdLog(rc *restfulx.ReqCtx) { ms := make(map[string]interface{}) err := json.Unmarshal([]byte(data.CmdContent), &ms) biz.ErrIsNil(err, "指令格式不正确") + biz.IsTrue(len(ms) > 0, "指令格式不正确") data.Id = model2.GenerateID() data.State = "2" data.RequestTime = time.Now().Format("2006-01-02 15:04:05")