diff --git a/backend/utils/files/fileinfo.go b/backend/utils/files/fileinfo.go index ecda89753..098ff4732 100644 --- a/backend/utils/files/fileinfo.go +++ b/backend/utils/files/fileinfo.go @@ -115,6 +115,9 @@ func (f *FileInfo) search(dir, showHidden bool, af afero.Afero, search string, c Path: path, FileInfo: info, }) + if len(files) > count { + return nil + } } } return nil diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 477e9f95a..20f96d64b 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -89,8 +89,12 @@ class RequestHttp { get(url: string, params?: object, _object = {}): Promise> { return this.service.get(url, { params, ..._object }); } - post(url: string, params?: object, _object = {}): Promise> { - return this.service.post(url, params, _object); + post(url: string, params?: object, timeout?: number): Promise> { + return this.service.post(url, params, { + baseURL: import.meta.env.VITE_API_URL as string, + timeout: timeout ? timeout : (ResultEnum.TIMEOUT as number), + withCredentials: true, + }); } put(url: string, params?: object, _object = {}): Promise> { return this.service.put(url, params, _object); diff --git a/frontend/src/api/modules/files.ts b/frontend/src/api/modules/files.ts index 43babce3e..6a58f7eed 100644 --- a/frontend/src/api/modules/files.ts +++ b/frontend/src/api/modules/files.ts @@ -3,7 +3,7 @@ import http from '@/api'; import { AxiosRequestConfig } from 'axios'; export const GetFilesList = (params: File.ReqFile) => { - return http.post('files/search', params); + return http.post('files/search', params, 200000); }; export const GetFilesTree = (params: File.ReqFile) => {