mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 02:04:26 +08:00
check whether user is logined when entering every page
This commit is contained in:
+18
-8
@@ -76,35 +76,43 @@ const router = createRouter({
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: HomePage
|
component: HomePage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/transactions',
|
path: '/transactions',
|
||||||
component: TransactionsPage
|
component: TransactionsPage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/statistics/transaction',
|
path: '/statistics/transaction',
|
||||||
component: StatisticsTransactionPage
|
component: StatisticsTransactionPage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/accounts',
|
path: '/accounts',
|
||||||
component: AccountsPage
|
component: AccountsPage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/categories',
|
path: '/categories',
|
||||||
component: TransactionCategoriesPage
|
component: TransactionCategoriesPage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/tags',
|
path: '/tags',
|
||||||
component: TransactionTagsPage
|
component: TransactionTagsPage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/exchange_rates',
|
path: '/exchange_rates',
|
||||||
component: ExchangeRatesPage
|
component: ExchangeRatesPage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/user/settings',
|
path: '/user/settings',
|
||||||
component: UserSettingsPage,
|
component: UserSettingsPage,
|
||||||
|
beforeEnter: checkLogin,
|
||||||
props: route => ({
|
props: route => ({
|
||||||
tab: route.query.tab
|
tab: route.query.tab
|
||||||
})
|
})
|
||||||
@@ -112,13 +120,15 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: '/app/settings',
|
path: '/app/settings',
|
||||||
component: AppSettingsPage,
|
component: AppSettingsPage,
|
||||||
|
beforeEnter: checkLogin,
|
||||||
props: route => ({
|
props: route => ({
|
||||||
tab: route.query.tab
|
tab: route.query.tab
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/about',
|
path: '/about',
|
||||||
component: AboutPage
|
component: AboutPage,
|
||||||
|
beforeEnter: checkLogin
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user