Redirect /profile to my profile.
This commit is contained in:
parent
24bf40f5f1
commit
3b54a5e6a3
1 changed files with 10 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ const router = createRouter({
|
|||
title: 'Profile',
|
||||
},
|
||||
name: 'profile',
|
||||
path: '/profile',
|
||||
path: '/profile/:username?',
|
||||
},
|
||||
{
|
||||
component: StickerBuilderView,
|
||||
|
|
@ -78,6 +78,15 @@ router.beforeEach((to, from) => {
|
|||
return {name: 'welcome'};
|
||||
} else if (!userStore.isAnonymous && to.name == 'welcome') {
|
||||
return {name: 'home'};
|
||||
} else if (to.name == 'profile' && to.params.username == "") {
|
||||
if (userStore.isAnonymous) {
|
||||
return {name: 'home'};
|
||||
} else {
|
||||
// Send to "my" profile page.
|
||||
return {name: 'profile', params: {
|
||||
username: userStore.user.username,
|
||||
}};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue