From c2297cdf302b29d226e4a8ec400f18598d98d043 Mon Sep 17 00:00:00 2001 From: tangtanglove Date: Fri, 31 Mar 2023 15:38:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/app/handler/tool/upload/file.go | 21 +++++++-------------- pkg/app/handler/tool/upload/image.go | 25 +++++++++---------------- pkg/builder/engine.go | 2 +- 3 files changed, 17 insertions(+), 31 deletions(-) diff --git a/pkg/app/handler/tool/upload/file.go b/pkg/app/handler/tool/upload/file.go index ea6c9e8..770ef0b 100644 --- a/pkg/app/handler/tool/upload/file.go +++ b/pkg/app/handler/tool/upload/file.go @@ -88,22 +88,15 @@ func (p *File) AfterHandle(ctx *builder.Context, result *storage.FileInfo) inter result.Url = (&model.File{}).GetPath(result.Url) } - adminInfo, err := (&model.Admin{}).GetAuthUser(ctx.Engine.GetConfig().AppKey, ctx.Token()) - if err != nil { - return ctx.JSON(200, msg.Error(err.Error(), "")) - } - // 插入数据库 id, err := (&model.File{}).InsertGetId(&model.File{ - ObjType: "ADMINID", - ObjId: adminInfo.Id, - Name: result.Name, - Size: result.Size, - Ext: result.Ext, - Path: result.Path, - Url: result.Url, - Hash: result.Hash, - Status: 1, + Name: result.Name, + Size: result.Size, + Ext: result.Ext, + Path: result.Path, + Url: result.Url, + Hash: result.Hash, + Status: 1, }) if err != nil { return ctx.JSON(200, msg.Error(err.Error(), "")) diff --git a/pkg/app/handler/tool/upload/image.go b/pkg/app/handler/tool/upload/image.go index b725e15..b08cda8 100644 --- a/pkg/app/handler/tool/upload/image.go +++ b/pkg/app/handler/tool/upload/image.go @@ -78,24 +78,17 @@ func (p *Image) AfterHandle(ctx *builder.Context, result *storage.FileInfo) inte result.Url = (&model.Picture{}).GetPath(result.Url) } - adminInfo, err := (&model.Admin{}).GetAuthUser(ctx.Engine.GetConfig().AppKey, ctx.Token()) - if err != nil { - return msg.Error(err.Error(), "") - } - // 插入数据库 id, err := (&model.Picture{}).InsertGetId(&model.Picture{ - ObjType: "ADMINID", - ObjId: adminInfo.Id, - Name: result.Name, - Size: result.Size, - Width: result.Width, - Height: result.Height, - Ext: result.Ext, - Path: result.Path, - Url: result.Url, - Hash: result.Hash, - Status: 1, + Name: result.Name, + Size: result.Size, + Width: result.Width, + Height: result.Height, + Ext: result.Ext, + Path: result.Path, + Url: result.Url, + Hash: result.Hash, + Status: 1, }) if err != nil { diff --git a/pkg/builder/engine.go b/pkg/builder/engine.go index e9cd113..12b9b13 100644 --- a/pkg/builder/engine.go +++ b/pkg/builder/engine.go @@ -19,7 +19,7 @@ const ( AppName = "QuarkGo" // Version of current package - Version = "1.1.46" + Version = "1.1.47" // 静态文件URL RespositoryURL = "https://github.com/quarkcms/quark-go/tree/main/website/"