Version: 0.7.6.dev.260325

后端:
- ♻️ 将 `taskquery` 模块迁移至 `agent2`,并完成与 `agent2` 业务链路及整体结构的正式接入

前端:
- 🧱 已完成基础框架搭建,并完成了登录、注册、主页等页面并对接了对应接口;但整体功能实现仍在完善中
This commit is contained in:
Losita
2026-03-25 00:49:16 +08:00
parent f4ef6fb256
commit e06284d0b0
52 changed files with 8847 additions and 468 deletions

View File

@@ -0,0 +1,56 @@
import { createRouter, createWebHistory } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
import AuthView from '@/views/AuthView.vue'
import DashboardView from '@/views/DashboardView.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
redirect: '/dashboard',
},
{
path: '/auth',
name: 'auth',
component: AuthView,
meta: {
guestOnly: true,
},
},
{
path: '/dashboard',
name: 'dashboard',
component: DashboardView,
meta: {
requiresAuth: true,
},
},
],
})
router.beforeEach((to) => {
const authStore = useAuthStore()
// 1. 进入受保护页面前,必须先确认 access token 是否存在。
// 2. 当前阶段只做“是否登录”的前端兜底,不在这里做 token 过期解析。
if (to.meta.requiresAuth && !authStore.isAuthenticated) {
return {
name: 'auth',
query: {
redirect: to.fullPath,
},
}
}
if (to.meta.guestOnly && authStore.isAuthenticated) {
return {
name: 'dashboard',
}
}
return true
})
export default router