From 5e7f1e1a134bbe4f25949bed75a4a978fc4f52e5 Mon Sep 17 00:00:00 2001 From: tiyee Date: Sun, 26 Jun 2022 13:13:24 +0800 Subject: [PATCH] enhance wxm support --- server/pkg/handle/init.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/pkg/handle/init.go b/server/pkg/handle/init.go index a8c3b9e..4d95c40 100644 --- a/server/pkg/handle/init.go +++ b/server/pkg/handle/init.go @@ -42,14 +42,13 @@ func Init(c *fasthttp.RequestCtx) { c.Success("application/json", ret(1, "数据不合法", size)) return } + // todo: 此处应该根据digest去数据库或缓存判断一下,如果存在直接返回文件地址,但是我为了减少依赖,没有引用数据库和redis. mime := http.DetectContentType(chunk) ext := uploader.Ext(mime) if ext == "" { c.Success("application/json", ret(1, "文件类型不合法", size)) return } - fmt.Println(string(digest), size, chunkSize, http.DetectContentType(chunk)) - c.PostBody() fn := func(m *uploader.Meta) { m.ChunkSize = chunkSize m.Object = "uploader/" + time.Now().Format("20060102150405") + "." + ext