success validate getting token via cookie

This commit is contained in:
AceDataCloud committed 2022-02-05 16:14:24 +08:00
1 parent a63c85796b
commit bee5606474
6 files changed
+29 -5

No files matched your search

File renamed without changes.
+5
View File
@@ -0,0 +1,5 @@
<template>
<div>
<h1>Course List</h1>
</div>
</template>
+15
View File
@@ -0,0 +1,15 @@
export default {
path: '/course',
name: 'course',
meta: {
auth: true
},
component: () => import('@/layouts/Course.vue'),
children: [
{
path: '',
name: 'course-list',
component: () => import('@/pages/course/List.vue')
}
]
};
+3 -2
View File
@@ -1,8 +1,9 @@
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
import auth from './auth';
import course from './course';
import store from '@/store';
const routes = [auth];
const routes = [auth, course];
const router = createRouter({
history: createWebHistory(),
@@ -14,7 +15,7 @@ router.beforeEach((to, from, next) => {
if (to.matched.some((record) => record.meta.auth)) {
if (!store.getters.authenticated) {
next({
name: 'login',
name: 'auth-login',
query: { redirect: to.fullPath }
});
} else {