check whether user is logined when entering every page

This commit is contained in:
MaysWind
2023-07-23 01:33:42 +08:00
parent 5d7e685dc4
commit af00032ee9
+18 -8
View File
@@ -76,35 +76,43 @@ const router = createRouter({
children: [
{
path: '',
component: HomePage
component: HomePage,
beforeEnter: checkLogin
},
{
path: '/transactions',
component: TransactionsPage
component: TransactionsPage,
beforeEnter: checkLogin
},
{
path: '/statistics/transaction',
component: StatisticsTransactionPage
component: StatisticsTransactionPage,
beforeEnter: checkLogin
},
{
path: '/accounts',
component: AccountsPage
component: AccountsPage,
beforeEnter: checkLogin
},
{
path: '/categories',
component: TransactionCategoriesPage
component: TransactionCategoriesPage,
beforeEnter: checkLogin
},
{
path: '/tags',
component: TransactionTagsPage
component: TransactionTagsPage,
beforeEnter: checkLogin
},
{
path: '/exchange_rates',
component: ExchangeRatesPage
component: ExchangeRatesPage,
beforeEnter: checkLogin
},
{
path: '/user/settings',
component: UserSettingsPage,
beforeEnter: checkLogin,
props: route => ({
tab: route.query.tab
})
@@ -112,13 +120,15 @@ const router = createRouter({
{
path: '/app/settings',
component: AppSettingsPage,
beforeEnter: checkLogin,
props: route => ({
tab: route.query.tab
})
},
{
path: '/about',
component: AboutPage
component: AboutPage,
beforeEnter: checkLogin
}
]
},