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