From c9fd11390ca85a7f3fd7e30ec5f1402d362f0c12 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期二, 17 十二月 2019 19:52:36 +0800 Subject: [PATCH] add filePort --- controllers/camera.go | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/camera.go b/controllers/camera.go index b41282c..882e043 100644 --- a/controllers/camera.go +++ b/controllers/camera.go @@ -339,18 +339,19 @@ util.ResponseFormat(c, code.RequestParamError, "鍙傛暟鏈夎") return } - if strings.HasPrefix(cid, File_Video_Id_Pre) || strings.HasPrefix(cid, File_Video_Id_Pre) || strings.HasPrefix(cid, File_Video_Id_Pre) { + if strings.HasPrefix(cid, File_Video_Id_Pre) || strings.HasPrefix(cid, File_Img_Id_Pre) || strings.HasPrefix(cid, File_Audio_Id_Pre) { var fileApi dbapi.FileAnalysisApi b, d := fileApi.Show(cid) if b { var file protomsg.FileAnalysis bytes, _ := json.Marshal(d) err := json.Unmarshal(bytes, &file) - if err !=nil { + if err == nil { util.ResponseFormat(c, code.Success, map[string]string{ "cameraId": cid, "snapshotUrl": file.SnapshotUrl, }) + return } else { util.ResponseFormat(c, code.ComError, "鏇存柊澶辫触") return -- Gitblit v1.8.0