refs #5989 fix: correct redirect
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-08-09 12:57:35 +02:00
parent e326e4e4d7
commit 20c15020a0
1 changed files with 3 additions and 2 deletions

View File

@ -20,14 +20,15 @@ defineExpose({
const pinnedModules = computed(() => navigation.getPinnedModules());
async function redirect() {
if (route.path == '/dashboard') return (window.location.href = await getUrl(''));
let section = route.path.substring(1);
if (!route.path.includes('/')) return (window.location.href = await getUrl(section));
section = section.substring(0, section.indexOf('/'));
if (route?.params?.id)
return (window.location.href = await getUrl(
`${section}/${route.params.id}/summary`
));
return (window.location.href = await getUrl(section + 'dashboard'));
return (window.location.href = await getUrl(section + '/index'));
}
</script>