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`, {
|
|
|
|
params: { file },
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
};
|