Compare commits

..

No commits in common. "a5b40c08724205712c8405b1c7c753d065627450" and "b6d8cece7d1ed85c1d486ce165f36c93b3d1d478" have entirely different histories.

1 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package handler package handler
import ( import (
"fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"net/http" "net/http"
"videoplayer/dao" "videoplayer/dao"
@ -30,11 +31,12 @@ func UploadFile(c *gin.Context) {
id, _ := c.Get("id") id, _ := c.Get("id")
id1 := int(id.(float64)) id1 := int(id.(float64))
//从请求头获取upload_type //从请求头获取upload_type
uploadType := c.PostForm("upload_type") uploadType := c.Request.Header.Get("upload_type")
if uploadType == "" { fmt.Println("header:", c.Request.Header)
c.JSON(http.StatusOK, gin.H{"error": "upload_type is empty", "code": proto.ParameterError, "message": "failed"}) //if uploadType == "" {
return // c.JSON(http.StatusOK, gin.H{"error": "upload_type is empty", "code": proto.ParameterError, "message": "failed"})
} // return
//}
user := dao.FindUserByUserID(id1) user := dao.FindUserByUserID(id1)
if user.Upload == false { if user.Upload == false {