default Alova v2

This commit is contained in:
proddy
2024-08-10 10:22:14 +02:00
parent efa9718081
commit bb98042957
38 changed files with 574 additions and 287 deletions

View File

@@ -24,15 +24,29 @@ export const fetchLog = () => alovaInstance.Post('/rest/fetchLog');
export const fetchLogES = () => alovaInstance.Get('/es/log');
// Get versions from github
// Alova 3 code...
// export const getStableVersion = () =>
// alovaInstanceGH.Get('latest', {
// transform(response: { data: { name: string } }) {
// return response.data.name.substring(1);
// }
// });
// export const getDevVersion = () =>
// alovaInstanceGH.Get('tags/latest', {
// transform(response: { data: { name: string } }) {
// return response.data.name.split(/\s+/).splice(-1)[0].substring(1);
// }
// });
export const getStableVersion = () =>
alovaInstanceGH.Get('latest', {
transform(response: { data: { name: string } }) {
transformData(response: { data: { name: string } }) {
return response.data.name.substring(1);
}
});
export const getDevVersion = () =>
alovaInstanceGH.Get('tags/latest', {
transform(response: { data: { name: string } }) {
transformData(response: { data: { name: string } }) {
return response.data.name.split(/\s+/).splice(-1)[0].substring(1);
}
});