Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions backend/app/service/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ func (f *FileService) Create(op request.FileCreate) error {
}

func (f *FileService) Delete(op request.FileDelete) error {
excludeDir := global.CONF.System.DataDir
if strings.Contains(op.Path, ".1panel_clash") || op.Path == excludeDir {
return buserr.New(constant.ErrPathNotDelete)
if op.IsDir {
excludeDir := global.CONF.System.DataDir
if strings.Contains(op.Path, ".1panel_clash") || op.Path == excludeDir {
return buserr.New(constant.ErrPathNotDelete)
}
}
fo := files.NewFileOp()
recycleBinStatus, _ := settingRepo.Get(settingRepo.WithByKey("FileRecycleBin"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个C#代码看起来是针对阿里云对象存储使用的,但是由于我无法访问外部的文件夹或其他系统配置信息,所以我不能对它做任何直接的更改。如果您需要我的帮助来解决特定于该语言和环境的具体问题,请提供更多信息,比如错误提示或功能需求。

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/views/host/file-management/delete/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ const getStatus = async () => {
const onConfirm = async () => {
const pros = [];
for (const s of files.value) {
if (s['path'].indexOf('.1panel_clash') > -1) {
MsgWarning(i18n.global.t('file.clashDeleteAlert'));
return;
}
if (s['isDir']) {
if (s['path'].indexOf('.1panel_clash') > -1) {
MsgWarning(i18n.global.t('file.clashDeleteAlert'));
return;
}
const pathRes = await loadBaseDir();
if (s['path'] === pathRes.data) {
MsgWarning(i18n.global.t('file.panelInstallDir'));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对不起,你没有提供代码片段,请提供具体的内容以便进行评估和反馈。

Expand Down