Merge branch 'dev' of https://gitea-net.fontree.cn/fiee/fonchain-fiee into dev
This commit is contained in:
commit
ebdd4aa6f0
@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"fonchain-fiee/api/files"
|
"fonchain-fiee/api/files"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/service/bundle/common"
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
@ -102,6 +103,15 @@ func Create(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Delete(ctx *gin.Context) {
|
func Delete(ctx *gin.Context) {
|
||||||
|
path := ctx.DefaultQuery("path", "/")
|
||||||
|
nowYear := time.Now().Year()
|
||||||
|
nowMonth := time.Now().Month()
|
||||||
|
nowYearPath := fmt.Sprintf("/fiee/video/%d", nowYear)
|
||||||
|
nowMonthPath := fmt.Sprintf("/fiee/video/%d/%d", nowYear, nowMonth)
|
||||||
|
if path == nowYearPath || path == nowMonthPath || path == "/fiee" || path == "/fiee/video" {
|
||||||
|
service.Error(ctx, errors.New("无法删除该目录"))
|
||||||
|
return
|
||||||
|
}
|
||||||
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
|
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
|
||||||
Path: ctx.DefaultQuery("path", "/"),
|
Path: ctx.DefaultQuery("path", "/"),
|
||||||
UserSpacePath: getUserSpacePath(ctx),
|
UserSpacePath: getUserSpacePath(ctx),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user