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-12-09 05:24:17 +00:00
|
|
|
params: { file },
|
2022-06-26 19:13:52 +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);
|
|
|
|
});
|
|
|
|
};
|