From 4c01b1e542fb5de979029d7bf382a3118b92fbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:12:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=20(#7035)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/service/file.go b/backend/app/service/file.go index 1d5b739b1..44164b67e 100644 --- a/backend/app/service/file.go +++ b/backend/app/service/file.go @@ -213,7 +213,7 @@ func (f *FileService) Create(op request.FileCreate) error { func (f *FileService) Delete(op request.FileDelete) error { if op.IsDir { 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) } }