fix(storage) handle download filename
This commit is contained in:
@@ -73,7 +73,7 @@ func (df *DocFolderWithChildren) ToTreeSchema() *schema.DocFolderWithChildren {
|
||||
|
||||
type Doc struct {
|
||||
Base
|
||||
Name string `gorm:"column:name;type:varchar;not null"` // 文件夹名称
|
||||
Name string `gorm:"column:name;type:varchar;not null"` // 文件名称
|
||||
IsDeletable bool `gorm:"column:is_deletable;type:boolean;not null;default:true"` // 是否允许被删除
|
||||
IsEditable bool `gorm:"column:is_editable;type:boolean;not null;default:true"` // 是否允许编辑名称
|
||||
FolderID string `gorm:"column:folder_id;type:varchar;index:idx_folder_id"` // 文件夹ID
|
||||
@@ -98,7 +98,7 @@ func (d *Doc) ToSchema(ctx context.Context) *schema.Doc {
|
||||
}
|
||||
|
||||
func (d *Doc) PresignedURL(ctx context.Context) (*url.URL, error) {
|
||||
return dal.GetStorage().PresignedGetObject(ctx, d.ObjectName, time.Hour)
|
||||
return dal.GetStorage().PresignedGetObject(ctx, d.ObjectName, time.Hour, d.Name)
|
||||
}
|
||||
|
||||
func (*Doc) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user