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/"