success validate getting token via cookie
This commit is contained in:
1 parent
a63c85796b
commit
bee5606474
6 files changed
+29
-5
No files matched your search
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
zhishuyun-auth-frontend:
|
zhishuyun-academy-frontend:
|
||||||
container_name: 'zhishuyun-auth-frontend'
|
container_name: 'zhishuyun-academy-frontend'
|
||||||
build: ./
|
build: ./
|
||||||
image: 'ghcr.io/zhishuyun/zhishuyun-auth-frontend:${BUILD_NUMBER}'
|
image: 'ghcr.io/zhishuyun/zhishuyun-academy-frontend:${BUILD_NUMBER}'
|
||||||
ports:
|
ports:
|
||||||
- '8086:80'
|
- '8086:80'
|
||||||
File renamed without changes.
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1>Course List</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -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
@@ -1,8 +1,9 @@
|
|||||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||||
import auth from './auth';
|
import auth from './auth';
|
||||||
|
import course from './course';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
|
||||||
const routes = [auth];
|
const routes = [auth, course];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
@@ -14,7 +15,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
if (to.matched.some((record) => record.meta.auth)) {
|
if (to.matched.some((record) => record.meta.auth)) {
|
||||||
if (!store.getters.authenticated) {
|
if (!store.getters.authenticated) {
|
||||||
next({
|
next({
|
||||||
name: 'login',
|
name: 'auth-login',
|
||||||
query: { redirect: to.fullPath }
|
query: { redirect: to.fullPath }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user