前端差不多,需要后端接收文件

This commit is contained in:
2026-01-16 20:49:11 +08:00
parent 56d4b104eb
commit 6396b79ac5
7 changed files with 519 additions and 129 deletions
+15 -1
View File
@@ -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) {