搜索结果修改为相对路径

This commit is contained in:
lzh 2025-06-24 16:35:26 +08:00
parent ac01536de2
commit c9989fa938

View File

@ -123,7 +123,7 @@ func (f *FilesProvider) Search(ctx context.Context, req *filesApi.SearchReq) (*f
err := search.Search(fs, req.Path, req.Query, rules.EmptyChecker, func(path string, f os.FileInfo) error { err := search.Search(fs, req.Path, req.Query, rules.EmptyChecker, func(path string, f os.FileInfo) error {
result.Items = append(result.Items, &filesApi.SearchResp_Nested{ result.Items = append(result.Items, &filesApi.SearchResp_Nested{
IsDir: f.IsDir(), IsDir: f.IsDir(),
Path: req.Path + "/" + path, Path: path,
Name: f.Name(), Name: f.Name(),
Size: f.Size(), Size: f.Size(),
ModTime: f.ModTime().UnixMilli(), ModTime: f.ModTime().UnixMilli(),