2019-09-28 21:59:05 +00:00
|
|
|
import http from '@/api/http';
|
|
|
|
|
|
|
|
export default (server: string, file: string): Promise<string> => {
|
|
|
|
return new Promise((resolve, reject) => {
|
2019-09-29 22:32:22 +00:00
|
|
|
http.get(`/api/client/servers/${server}/files/contents`, {
|
2020-11-07 04:47:03 +00:00
|
|
|
params: { file: encodeURI(decodeURI(file)) },
|
2019-09-29 22:32:22 +00:00
|
|
|
transformResponse: res => res,
|
2019-12-07 20:12:33 +00:00
|
|
|
responseType: 'text',
|
2019-09-29 22:32:22 +00:00
|
|
|
})
|
2019-09-28 21:59:05 +00:00
|
|
|
.then(({ data }) => resolve(data))
|
|
|
|
.catch(reject);
|
|
|
|
});
|
|
|
|
};
|