diff options
| author | Hakaba Hitoyo <example@example.com> | 2018-04-29 17:55:23 +0900 |
|---|---|---|
| committer | Hakaba Hitoyo <example@example.com> | 2018-04-29 17:55:23 +0900 |
| commit | 2a6721ea562226d17e6e893f4fa822a8c20c63cc (patch) | |
| tree | cf14a33ffafe8a60951e0da482607d8c398322c2 /src | |
| parent | df486e18c28fa7fa3657a90eafe6d1cd7229f874 (diff) | |
redirect root by login or not
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.js b/src/main.js index 6f8c00f0..9c79f941 100644 --- a/src/main.js +++ b/src/main.js @@ -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 }, |
