From 743ac6a55fb6b606ecab2a837a81cc4116a063f1 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Fri, 30 Aug 2024 14:48:19 +0800 Subject: [PATCH] upload type --- handler/tool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler/tool.go b/handler/tool.go index f9c593d..f678fab 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -30,7 +30,7 @@ func UploadFile(c *gin.Context) { id, _ := c.Get("id") id1 := int(id.(float64)) //从请求头获取upload_type - uploadType := c.GetHeader("upload_type") + uploadType := c.Request.Header.Get("upload_type") if uploadType == "" { c.JSON(http.StatusOK, gin.H{"error": "upload_type is empty", "code": proto.ParameterError, "message": "failed"}) return