forked from verdnatura/salix-front
refs #6067 feat(verifyEmail): use urls/get-by-user
This commit is contained in:
parent
4193876917
commit
b4fb049cdf
|
@ -4,7 +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';
|
import axios from 'axios';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
@ -14,21 +14,27 @@ const redirectButtons = ref([]);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const params = route?.query;
|
const params = route?.query;
|
||||||
|
const { data } = await axios.get(`Urls/${params.userId}/get-by-user`);
|
||||||
|
|
||||||
redirectButtons.value.push({
|
redirectButtons.value.push({
|
||||||
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: await getUrl(null, 'hedera'),
|
url: data.find((url) => url.appName == 'hedera').url,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (params?.isWorker && JSON.parse(params?.isWorker)) {
|
const urls = data.filter((url) => url.appName != 'hedera');
|
||||||
|
if (urls.length) {
|
||||||
|
for (const url of urls) {
|
||||||
redirectButtons.value.push({
|
redirectButtons.value.push({
|
||||||
color: 'bg-primary',
|
color: 'bg-primary',
|
||||||
icon: new URL(`../../assets/salix_icon.svg`, import.meta.url).href,
|
icon: new URL(`../../assets/${url.appName}_icon.svg`, import.meta.url)
|
||||||
|
.href,
|
||||||
text: 'logIn',
|
text: 'logIn',
|
||||||
url: '',
|
url: url.url,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue