Encode all parts of the URI individually, closes #2620
This commit is contained in:
parent
9ff691bfde
commit
8c8feffcb7
|
@ -3,7 +3,7 @@ import http from '@/api/http';
|
||||||
export default (server: string, file: string): Promise<string> => {
|
export default (server: string, file: string): Promise<string> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
http.get(`/api/client/servers/${server}/files/contents`, {
|
http.get(`/api/client/servers/${server}/files/contents`, {
|
||||||
params: { file },
|
params: { file: file.split('/').map(item => encodeURIComponent(item)).join('/') },
|
||||||
transformResponse: res => res,
|
transformResponse: res => res,
|
||||||
responseType: 'text',
|
responseType: 'text',
|
||||||
})
|
})
|
||||||
|
|
|
@ -17,7 +17,7 @@ export interface FileObject {
|
||||||
|
|
||||||
export default async (uuid: string, directory?: string): Promise<FileObject[]> => {
|
export default async (uuid: string, directory?: string): Promise<FileObject[]> => {
|
||||||
const { data } = await http.get(`/api/client/servers/${uuid}/files/list`, {
|
const { data } = await http.get(`/api/client/servers/${uuid}/files/list`, {
|
||||||
params: { directory },
|
params: { directory: directory?.split('/').map(item => encodeURIComponent(item)).join('/') },
|
||||||
});
|
});
|
||||||
|
|
||||||
return (data.data || []).map(rawDataToFileObject);
|
return (data.data || []).map(rawDataToFileObject);
|
||||||
|
|
|
@ -14,6 +14,7 @@ export default () => {
|
||||||
focusThrottleInterval: 30000,
|
focusThrottleInterval: 30000,
|
||||||
revalidateOnMount: false,
|
revalidateOnMount: false,
|
||||||
refreshInterval: 0,
|
refreshInterval: 0,
|
||||||
|
errorRetryCount: 2,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue