This commit is contained in:
toom1996
2026-09-14 21:30:15 +08:00
parent 548155625d
commit afff2d9a49
52 changed files with 2997 additions and 2753 deletions

View File

@ -3,9 +3,7 @@ import '@/styles/global.css'
import LoadingScreen from '@/components/LoadingScreen.astro'
import AuthModal from '@/components/AuthModal.astro'
import { href, ROUTES } from '@/lib/routes'
import { getI18n } from '@/i18n/utils'
import { LOCALE_NAMES } from '@/i18n/config'
import { setApiLocale } from '@/lib/locale'
import { getI18n, LOCALE_NAMES, setApiLocale } from '@/lib/i18n'
import { i18n } from 'astro:config/client';
import { toCodes } from 'astro:i18n';
@ -180,6 +178,7 @@ const headers = {
<footer class="relative z-[1] bg-white mt-20 pt-10 border-t-2 border-black text-black w-full font-sans">
<script>
import { getUser } from "@/lib/auth"
import type { AuthUser } from "@/lib/auth"
import { fetchMe, logout, enforceIdleLogout } from "@/lib/api"
// 空闲登出:超过 config.idleLogoutDays 天没访问则登出(在 Alpine 初始化前先跑,避免登录态闪烁)
@ -187,7 +186,7 @@ const headers = {
document.addEventListener("alpine:init", () => {
Alpine.data("authMenu", () => ({
user: null,
user: null as AuthUser | null,
open: false,
init() {