upload type

This commit is contained in:
junleea 2024-08-30 15:13:23 +08:00
parent 0b503558ef
commit db726b078e
1 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,6 @@
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"
@ -31,12 +30,11 @@ 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.Request.Header.Get("upload_type") uploadType := c.PostForm("upload_type")
fmt.Println("header:", c.Request.Header) if uploadType == "" {
//if uploadType == "" { c.JSON(http.StatusOK, gin.H{"error": "upload_type is empty", "code": proto.ParameterError, "message": "failed"})
// c.JSON(http.StatusOK, gin.H{"error": "upload_type is empty", "code": proto.ParameterError, "message": "failed"}) return
// return }
//}
user := dao.FindUserByUserID(id1) user := dao.FindUserByUserID(id1)
if user.Upload == false { if user.Upload == false {