redirect root by login or not

This commit is contained in:
Hakaba Hitoyo 2018-04-29 17:55:23 +09:00
parent df486e18c2
commit 2a6721ea56

View file

@ -98,7 +98,11 @@ window.fetch('/static/config.json')
}
const routes = [
{ name: 'root', path: '/', redirect: data['defaultPath'] || '/main/all' },
{ name: 'root', path: '/', redirect: to => {
var redirectRootLogin = data['redirectRootLogin']
var redirectRootNoLogin = data['redirectRootNoLogin']
return (store.state.users.currentUser? redirectRootLogin: redirectRootNoLogin) || '/main/all'
}},
{ path: '/main/all', component: PublicAndExternalTimeline },
{ path: '/main/public', component: PublicTimeline },
{ path: '/main/friends', component: FriendsTimeline },