This commit is contained in:
deepzz0
2016-12-18 19:09:30 +08:00
parent 5064894ab5
commit 19b87b6e53
3 changed files with 11 additions and 10 deletions

4
api.go
View File

@@ -430,7 +430,7 @@ func apiFileUpload(c *gin.Context) {
}
typ := c.Request.Header.Get("Content-Type")
c.JSON(http.StatusOK, gin.H{
"name": filename,
"title": filename,
"isImage": typ[:5] == "image",
"url": url,
"bytes": fmt.Sprintf("%dkb", s.Size()/1000),
@@ -445,7 +445,7 @@ func apiFileDelete(c *gin.Context) {
}
c.String(http.StatusOK, "删掉了吗?鬼知道。。。")
}()
name := c.PostForm("name")
name := c.PostForm("title")
if name == "" {
err = errors.New("参数错误")
return