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 VnLogo from 'components/ui/VnLogo.vue';
|
||||
import { getUrl } from 'src/composables/getUrl';
|
||||
import axios from 'axios';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
|
@ -14,20 +14,26 @@ const redirectButtons = ref([]);
|
|||
|
||||
onMounted(async () => {
|
||||
const params = route?.query;
|
||||
const { data } = await axios.get(`Urls/${params.userId}/get-by-user`);
|
||||
|
||||
redirectButtons.value.push({
|
||||
color: 'bg-vnColor',
|
||||
icon: new URL(`../../assets/vn_icon.svg`, import.meta.url).href,
|
||||
text: 'goToShop',
|
||||
url: await getUrl(null, 'hedera'),
|
||||
url: data.find((url) => url.appName == 'hedera').url,
|
||||
});
|
||||
|
||||
if (params?.isWorker && JSON.parse(params?.isWorker)) {
|
||||
redirectButtons.value.push({
|
||||
color: 'bg-primary',
|
||||
icon: new URL(`../../assets/salix_icon.svg`, import.meta.url).href,
|
||||
text: 'logIn',
|
||||
url: '',
|
||||
});
|
||||
const urls = data.filter((url) => url.appName != 'hedera');
|
||||
if (urls.length) {
|
||||
for (const url of urls) {
|
||||
redirectButtons.value.push({
|
||||
color: 'bg-primary',
|
||||
icon: new URL(`../../assets/${url.appName}_icon.svg`, import.meta.url)
|
||||
.href,
|
||||
text: 'logIn',
|
||||
url: url.url,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue