upload type
This commit is contained in:
parent
0b503558ef
commit
db726b078e
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue