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,
|
|
|
|
responseType: 'text/plain',
|
|
|
|
})
|
2019-09-28 21:59:05 +00:00
|
|
|
.then(({ data }) => resolve(data))
|
|
|
|
.catch(reject);
|
|
|
|
});
|
|
|
|
};
|