fix(*): 模型目录 - 修复前台开关、系统模型价格与访问控制

This commit is contained in:
ddCat
2026-08-22 20:57:31 +08:00
parent 5d9986f6c7
commit 1bb5d1423a
19 changed files with 989 additions and 84 deletions

View File

@@ -5,6 +5,7 @@ import { useNavigate, useSearchParams } from "react-router";
import { applyUserSession } from "@/lib/user-session";
import { getAuthSession, getAuthSettings, linuxDOLoginURL, login } from "@/services/api/auth";
import { useUserStore } from "@/stores/use-user-store";
import { LinuxDOIcon } from "./auth-scene";
export default function LoginPage() {
@@ -16,6 +17,15 @@ export default function LoginPage() {
const [submitting, setSubmitting] = useState(false);
const [linuxdoEnabled, setLinuxdoEnabled] = useState(false);
const next = safeNext(params.get("next"));
const user = useUserStore((state) => state.user);
const hydrated = useUserStore((state) => state.hydrated);
// 如果已登录,直接跳转
useEffect(() => {
if (hydrated && user) {
navigate(next, { replace: true });
}
}, [hydrated, user, next, navigate]);
useEffect(() => {
void getAuthSettings().then((settings) => setLinuxdoEnabled(settings.linuxdoEnabled)).catch(() => undefined);