'commit'
continuous-integration/drone/push Build is passing Details

master
黄海 4 years ago
parent 036731fd8a
commit 9dd79f6036

@ -1,13 +1,9 @@
[server] #gin服务器的端口 [server] #gin服务器的端口
port = 8010 port = 8010
[qiniu]
BUCKET = dsideal_yy
AK = PpUaj_b88y1yC6iBXT5axd607P0RZSCpu0TpclBC
SK = FN16FQuUEpOBDM_Bj-Rq-AP7h7umSBK5D7czn-aY
[savePath] [savePath]
path= d:/Test/ path= /usr/local/dsMin/dsSzxy/files/
[distribute] #发布功能的配置 [distribute] #发布功能的配置

Binary file not shown.

@ -85,6 +85,8 @@ func main() {
c.String(http.StatusBadRequest, fmt.Sprintf("upload file err: %s", err.Error())) c.String(http.StatusBadRequest, fmt.Sprintf("upload file err: %s", err.Error()))
return return
} }
//拼接的下载路径
downUrl := "/dsSzxy/down/" + trueName[0:2] + "/" + trueName
//判断扩展名是不是图片 //判断扩展名是不是图片
if ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp" { if ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp" {
//读取本地文件本地文件尺寸300*400 //读取本地文件本地文件尺寸300*400
@ -112,13 +114,13 @@ func main() {
sourceString := base64.StdEncoding.EncodeToString(sourceBuffer[:n]) sourceString := base64.StdEncoding.EncodeToString(sourceBuffer[:n])
c.JSON(200, gin.H{ c.JSON(200, gin.H{
"success": true, "success": true,
"url": trueName, "url": downUrl,
"thumbContent": sourceString, "thumbContent": sourceString,
}) })
} else { } else {
c.JSON(200, gin.H{ c.JSON(200, gin.H{
"success": true, "success": true,
"url": trueName, "url": downUrl,
}) })
} }
}) })

Loading…
Cancel
Save