mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
test: fix failed test
This commit is contained in:
@@ -106,7 +106,7 @@ func (service *ArchiveService) DownloadArchived(ctx context.Context, c *gin.Cont
|
||||
user := userRaw.(model.User)
|
||||
|
||||
// 创建文件系统
|
||||
fs, err := filesystem.NewFileSystemFromContext(c)
|
||||
fs, err := filesystem.NewFileSystem(&user)
|
||||
if err != nil {
|
||||
return serializer.Err(serializer.CodePolicyNotAllowed, err.Error(), err)
|
||||
}
|
||||
@@ -118,9 +118,6 @@ func (service *ArchiveService) DownloadArchived(ctx context.Context, c *gin.Cont
|
||||
return serializer.Err(404, "归档会话不存在", nil)
|
||||
}
|
||||
|
||||
// 清理打包会话
|
||||
_ = cache.Deletes([]string{service.ID, "user_" + service.ID}, "archive_")
|
||||
|
||||
// 开始打包
|
||||
c.Header("Content-Disposition", "attachment;")
|
||||
c.Header("Content-Type", "application/zip")
|
||||
@@ -268,7 +265,7 @@ func (service *FileIDService) CreateDownloadSession(ctx context.Context, c *gin.
|
||||
// Download 通过签名URL的文件下载,无需登录
|
||||
func (service *DownloadService) Download(ctx context.Context, c *gin.Context) serializer.Response {
|
||||
// 创建文件系统
|
||||
fs, err := filesystem.NewFileSystem(&user)
|
||||
fs, err := filesystem.NewFileSystemFromContext(c)
|
||||
if err != nil {
|
||||
return serializer.Err(serializer.CodePolicyNotAllowed, err.Error(), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user