success validate getting token via cookie

This commit is contained in:
AceDataCloud
2022-02-05 16:14:24 +08:00
parent a63c85796b
commit bee5606474
6 changed files with 29 additions and 5 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
version: '3'
services:
zhishuyun-auth-frontend:
container_name: 'zhishuyun-auth-frontend'
zhishuyun-academy-frontend:
container_name: 'zhishuyun-academy-frontend'
build: ./
image: 'ghcr.io/zhishuyun/zhishuyun-auth-frontend:${BUILD_NUMBER}'
image: 'ghcr.io/zhishuyun/zhishuyun-academy-frontend:${BUILD_NUMBER}'
ports:
- '8086:80'
+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 {
+3
View File
@@ -0,0 +1,3 @@
docker-compose build
docker-compose push
cat deploy/test/deployment.yaml | sed 's/\${TAG}/'"$BUILD_NUMBER"'/g' | kubectl apply -f - || true