This commit is contained in:
parent
468ed95702
commit
0f1dee42ec
|
@ -1,14 +1,11 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export async function getUrl(route, appName = 'salix') {
|
||||
let url;
|
||||
const filter = {
|
||||
where: { and: [{ appName: appName }, { environment: process.env.NODE_ENV }] },
|
||||
};
|
||||
|
||||
await axios.get('Urls/findOne', { params: { filter } }).then((res) => {
|
||||
url = res.data.url + route;
|
||||
});
|
||||
|
||||
return url;
|
||||
const { data } = await axios.get('Urls/findOne', { params: { filter } });
|
||||
const url = data.url;
|
||||
return route ? url + route : url;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useRoute } from 'vue-router';
|
||||
|
||||
import VnLogo from 'components/ui/VnLogo.vue';
|
||||
import { getUrl } from 'src/composables/getUrl';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
|
@ -17,7 +18,7 @@ onMounted(async () => {
|
|||
color: 'bg-vnColor',
|
||||
icon: new URL(`../../assets/vn_icon.svg`, import.meta.url).href,
|
||||
text: 'goToShop',
|
||||
url: params?.url,
|
||||
url: await getUrl(null, 'hedera'),
|
||||
});
|
||||
|
||||
if (params?.isWorker && JSON.parse(params?.isWorker)) {
|
||||
|
|
|
@ -63,6 +63,7 @@ class FormDataMock {
|
|||
}
|
||||
}
|
||||
global.FormData = FormDataMock;
|
||||
global.URL = class URL {};
|
||||
|
||||
export function createWrapper(component, options) {
|
||||
const defaultOptions = {
|
||||
|
|
Loading…
Reference in New Issue