feat: 新增鉴权

This commit is contained in:
2026-05-22 22:38:01 +08:00
parent b02f15f735
commit 3857f77f8b
38 changed files with 1697 additions and 195 deletions
+6
View File
@@ -0,0 +1,6 @@
// app/plugins/auth.client.ts - 客户端启动时拉取一次 session,供全局复用
// .client.ts 后缀确保只在浏览器端执行,避免 SSR 阶段因无 cookie 而误判未登录
export default defineNuxtPlugin(async () => {
const authStore = useAuthStore();
await authStore.fetchSession();
});