前端差不多,需要后端接收文件
This commit is contained in:
@@ -6,9 +6,23 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func file_save() {
|
||||
|
||||
}
|
||||
|
||||
func ApiFiles(r *gin.RouterGroup) {
|
||||
r.POST("/upload", func(ctx *gin.Context) {
|
||||
fmt.Print(ctx.FormFile("file"))
|
||||
|
||||
cookie := ctx.PostForm("cookie")
|
||||
file, _ := ctx.FormFile("file")
|
||||
//通过cookie获取用户信息
|
||||
_, err := AuthenticationAuthorityFromCookie(cookie)
|
||||
if err == nil {
|
||||
|
||||
}
|
||||
|
||||
fmt.Println(file.Filename)
|
||||
fmt.Println(cookie)
|
||||
ReturnJson(ctx, "apiOK", nil)
|
||||
})
|
||||
r.GET("/upload", func(ctx *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user