fix: 解决搜索子目录模糊查询失败的问题 (#1085)

Refs https://github.com/1Panel-dev/1Panel/issues/1049
This commit is contained in:
zhengkunwang223 2023-05-19 15:51:09 +08:00 committed by wanghe-fit2cloud
parent 56f8caf561
commit 4fd87568cd
2 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ func NewFileInfo(op FileOption) (*FileInfo, error) {
}
func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, total int, err error) {
cmd := exec.Command("find", f.Path, "-name", search)
cmd := exec.Command("find", f.Path, "-name", fmt.Sprintf("*%s*", search))
output, err := cmd.StdoutPipe()
if err != nil {
return

View File

@ -90,7 +90,7 @@
clearable
@clear="search()"
@keydown.enter="search()"
:placeholder="req.containSub ? $t('file.searchHelper') : $t('file.search')"
:placeholder="$t('file.search')"
>
<template #prepend>
<el-checkbox v-model="req.containSub">