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