refactor🎨 优化Context设置方法

This commit is contained in:
wenjianzhang committed 2021-05-12 18:47:29 +08:00
1 parent abcdf880fd
commit 70998c424d
6 files changed
+79 -85

No files matched your search

+2 -2
View File
@@ -41,7 +41,7 @@ type File struct {
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/public/uploadFile [post]
func (e File) UploadFile(c *gin.Context) {
e.SetContext(c)
e.MakeContext(c)
tag, _ := c.GetPostForm("type")
urlPrefix := fmt.Sprintf("http://%s/", c.Request.Host)
var fileResponse FileResponse
@@ -195,4 +195,4 @@ func ossUpload(name string, path string) error {
func qiniuUpload(name string, path string) error {
oss := file_store.ALiYunOSS{}
return oss.UpLoad(name, path)
}
}