mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 12:39:01 +08:00
fix: 删除目录校验 (#7035)
This commit is contained in:
parent
ec372dbb98
commit
4c01b1e542
@ -213,7 +213,7 @@ func (f *FileService) Create(op request.FileCreate) error {
|
|||||||
func (f *FileService) Delete(op request.FileDelete) error {
|
func (f *FileService) Delete(op request.FileDelete) error {
|
||||||
if op.IsDir {
|
if op.IsDir {
|
||||||
excludeDir := global.CONF.System.DataDir
|
excludeDir := global.CONF.System.DataDir
|
||||||
if strings.Contains(op.Path, ".1panel_clash") || op.Path == excludeDir {
|
if filepath.Base(op.Path) == ".1panel_clash" || op.Path == excludeDir {
|
||||||
return buserr.New(constant.ErrPathNotDelete)
|
return buserr.New(constant.ErrPathNotDelete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user