mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[fix]指令是空对象,仍能下发
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user