Skip to content

Commit

Permalink
fix: 解决搜索子目录模糊查询失败的问题 (#1085)
Browse files Browse the repository at this point in the history
Refs #1049
  • Loading branch information
zhengkunwang223 authored and wanghe-fit2cloud committed May 21, 2023
1 parent 56f8caf commit 4fd8756
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/utils/files/fileinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/host/file-management/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 4fd8756

Please sign in to comment.