salix-front/src/composables/getUrl.js

15 lines
353 B
JavaScript
Raw Normal View History

2023-04-17 08:48:13 +00:00
import axios from 'axios';
export async function getUrl(route, appName = 'salix') {
let url;
const filter = {
2023-07-10 04:04:05 +00:00
where: { and: [{ appName: appName }, { environment: process.env.NODE_ENV }] },
2023-04-17 08:48:13 +00:00
};
2023-07-10 04:04:05 +00:00
await axios.get('Urls/findOne', { params: { filter } }).then((res) => {
url = res.data.url + route;
});
2023-04-17 08:48:13 +00:00
return url;
}