From 69b6faa73fe893a9cd3bf16142f63a446c31566f Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期一, 05 八月 2019 19:38:05 +0800 Subject: [PATCH] fix bug --- controllers/fileController.go | 4 +++- extend/code/code.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/fileController.go b/controllers/fileController.go index 32e9cfc..9f05f67 100644 --- a/controllers/fileController.go +++ b/controllers/fileController.go @@ -562,6 +562,9 @@ } var rcFace *protomsg.Rect if err ==nil && len(faceArr) >0 { + if len(faceArr) >1 { + return "",nil, errors.New("TooManyFaces") + } for _,r := range faceArr { //鎷垮埌浜鸿劯鐨勫潗鏍� rcFace = r.Pos.RcFace @@ -584,7 +587,6 @@ idx := strings.Index(field, "/") field = field[idx+1:] } - fmt.Println("field:",field) ext := path.Ext(filename) fileNameOnly := strings.TrimSuffix(filename, ext) diff --git a/extend/code/code.go b/extend/code/code.go index 847808b..34c5c70 100644 --- a/extend/code/code.go +++ b/extend/code/code.go @@ -53,7 +53,7 @@ CompareResultGone = &Code{ http.StatusOK,true,"涓婃姣斿宸插け鏁堬紝璇蜂粠鏂版瘮瀵�"} - TaskStoped = &Code{http.StatusOK, true, "姝や换鍔′负鍋滅敤鐘舵�侊紝璇峰湪浠诲姟绠$悊涓紑鍚紒"} + TaskStoped = &Code{http.StatusOK, false, "姝や换鍔′负鍋滅敤鐘舵�侊紝璇峰湪浠诲姟绠$悊涓紑鍚紒"} ComError = &Code{http.StatusInternalServerError, false, ""} ) -- Gitblit v1.8.0