功能:完善多店铺登录与首次部署SQL
This commit is contained in:
@@ -13,19 +13,19 @@ const router = createRouter({
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: () => import('../views/HomeView.vue'),
|
||||
meta: { requiresAuth: true, isAdmin: false }
|
||||
meta: { requiresAuth: false, isAdmin: false }
|
||||
},
|
||||
{
|
||||
path: '/products',
|
||||
name: 'products',
|
||||
component: () => import('../views/ProductListView.vue'),
|
||||
meta: { requiresAuth: true, isAdmin: false }
|
||||
meta: { requiresAuth: false, isAdmin: false }
|
||||
},
|
||||
{
|
||||
path: '/product/:id',
|
||||
name: 'product-detail',
|
||||
component: () => import('../views/ProductDetailView.vue'),
|
||||
meta: { requiresAuth: true, hideNav: true, isAdmin: false }
|
||||
meta: { requiresAuth: false, hideNav: true, isAdmin: false }
|
||||
},
|
||||
{
|
||||
path: '/cart',
|
||||
@@ -43,7 +43,7 @@ const router = createRouter({
|
||||
path: '/shop/:id',
|
||||
name: 'shop-detail',
|
||||
component: () => import('../views/ShopDetailView.vue'),
|
||||
meta: { requiresAuth: true, hideNav: true, isAdmin: false }
|
||||
meta: { requiresAuth: false, hideNav: true, isAdmin: false }
|
||||
},
|
||||
{
|
||||
path: '/wishlist',
|
||||
@@ -273,8 +273,6 @@ router.beforeEach((to, _from, next) => {
|
||||
next('/')
|
||||
} else if (to.path === '/' && token) {
|
||||
next('/home')
|
||||
} else if (to.path === '/home' && !token) {
|
||||
next('/')
|
||||
} else {
|
||||
// 对于需要认证的页面,验证token的有效性
|
||||
if (requiresAuth && token) {
|
||||
|
||||
Reference in New Issue
Block a user