This commit is contained in:
parent
bf256574c9
commit
ac7462ec67
|
@ -7,6 +7,7 @@ import { useState } from 'src/composables/useState';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import PinnedModules from './PinnedModules.vue';
|
import PinnedModules from './PinnedModules.vue';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
|
@ -14,21 +15,28 @@ const stateStore = useStateStore();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
onMounted(() => stateStore.setMounted());
|
onMounted(() => stateStore. setMounted());
|
||||||
|
|
||||||
function redirect() {
|
async function redirect() {
|
||||||
const currentURL = window.location.href;
|
const currentURL = window.location.href;
|
||||||
const routeRegex = /\/#\/(\w+)(?:\/(\d+))?/;
|
const routeRegex = /\/(\w+)(?:\/(\d+))?/;
|
||||||
|
|
||||||
const match = currentURL.match(routeRegex);
|
const match = currentURL.match(routeRegex);
|
||||||
if (match) {
|
const [, element, number] = match;
|
||||||
const [, element, number] = match;
|
console.log(route.path);
|
||||||
const redirectURL =
|
const section = route.path.substring(route.path.indexOf('/'));
|
||||||
getUrl() + (number ? `${element}/${number}/summary` : `${element}/index`);
|
console.log(section);
|
||||||
window.location.href = redirectURL;
|
if (route?.params?.id) {
|
||||||
|
// const redirectURL =
|
||||||
|
// getUrl() + (number ? `${element}/${number}/summary` : `${element}/index`);
|
||||||
|
// window.location.href = redirectURL;
|
||||||
|
console.log(await getUrl(section));
|
||||||
|
window.location.href = await getUrl(section + route.params);
|
||||||
} else {
|
} else {
|
||||||
window.location.href = getUrl();
|
console.log(await getUrl(section));
|
||||||
|
|
||||||
|
// window.location.href = await getUrl('claim');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -80,7 +88,12 @@ function redirect() {
|
||||||
<QTooltip bottom>
|
<QTooltip bottom>
|
||||||
{{ t('globals.pinnedModules') }}
|
{{ t('globals.pinnedModules') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
<PinnedModules />
|
<PinnedModules>
|
||||||
|
<QBtn
|
||||||
|
@click="redirect(this.$route.params.id)"
|
||||||
|
icon="open_in_new"
|
||||||
|
></QBtn>
|
||||||
|
</PinnedModules>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn rounded dense flat no-wrap id="user">
|
<QBtn rounded dense flat no-wrap id="user">
|
||||||
<QAvatar size="lg">
|
<QAvatar size="lg">
|
||||||
|
|
Loading…
Reference in New Issue