From 3a5a495087c2c26f9a694a169e86e5bfd93ddd98 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期三, 17 七月 2019 14:08:45 +0800 Subject: [PATCH] fix weedfsUri --- controllers/fileController.go | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/fileController.go b/controllers/fileController.go index 3b641e0..7dbc615 100644 --- a/controllers/fileController.go +++ b/controllers/fileController.go @@ -14,13 +14,14 @@ "log" "mime/multipart" "net/http" + "strconv" "strings" "webserver/extend/code" + "webserver/extend/config" "webserver/extend/esutil" "webserver/extend/util" "webserver/models" "webserver/service" - ) type FileController struct { @@ -34,7 +35,6 @@ //var picUrlField = "fid" /**涓婁紶鏂规硶**/ -var weedfsUri = "http://192.168.1.182:6333/submit" //var weedfsUri = "http://192.168.1.182:9500/submit" @@ -99,7 +99,7 @@ util.ResponseFormat(c, code.RequestParamError, "鍙傛暟鏈夎") return } - + var weedfsUri = "http://"+config.WeedFs.Ip+":"+strconv.Itoa(config.WeedFs.UploadPort)+"/submit" //灏嗕笂浼犵殑鍥剧墖浜や汉鑴告娴嬪拰浜鸿劯鎻愬彇锛岃幏寰楃壒寰� fileBytes, _ := ioutil.ReadAll(file) @@ -164,6 +164,7 @@ break } } + var weedfsUri = "http://"+config.WeedFs.Ip+":"+strconv.Itoa(config.WeedFs.UploadPort)+"/submit" //鏍规嵁浜鸿劯鍧愭爣鎵e嚭浜鸿劯灏忓浘 cutFaceImgData := util.SubImg(*pI, int(rcFace.Left), int(rcFace.Top), int(rcFace.Right), int(rcFace.Bottom)) fileInfo, e := esutil.PostFormData(weedfsUri, filename, "file", cutFaceImgData) @@ -312,6 +313,7 @@ util.ResponseFormat(c, code.UploadFileError, err2.Error()) return } + var weedfsUri = "http://"+config.WeedFs.Ip+":"+strconv.Itoa(config.WeedFs.UploadPort)+"/submit" { uri := weedfsUri fileInfo, e := esutil.PostFormBufferData(uri, filename, "file", uploadData) -- Gitblit v1.8.0