feat: 修改超时时间

This commit is contained in:
zhengkunwang223 2023-02-06 17:14:19 +08:00 committed by zhengkunwang223
parent 292dbf58c5
commit 8f14bac6d7
3 changed files with 10 additions and 3 deletions

View file

@ -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

View file

@ -89,8 +89,12 @@ class RequestHttp {
get<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
return this.service.get(url, { params, ..._object });
}
post<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
return this.service.post(url, params, _object);
post<T>(url: string, params?: object, timeout?: number): Promise<ResultData<T>> {
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<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
return this.service.put(url, params, _object);

View file

@ -3,7 +3,7 @@ import http from '@/api';
import { AxiosRequestConfig } from 'axios';
export const GetFilesList = (params: File.ReqFile) => {
return http.post<File.File>('files/search', params);
return http.post<File.File>('files/search', params, 200000);
};
export const GetFilesTree = (params: File.ReqFile) => {