refactor(app): tighten feature boundaries

This commit is contained in:
2026-06-30 14:50:31 +08:00
parent 1fed21fa2f
commit ba6ce57e62
17 changed files with 126 additions and 52 deletions
+2 -4
View File
@@ -4,8 +4,8 @@ import { useEffect } from "react";
import { useRouter } from "next/navigation";
import { MobileShell } from "@/app/_components/core";
import { hasBusinessLoginToken } from "@/lib/auth/auth_session";
import { useAuthDispatch, useAuthState } from "@/stores/auth/auth-context";
import { AuthStorage } from "@/data/storage/auth/auth_storage";
import { ROUTES } from "@/router/routes";
import { pwaUtil, Logger } from "@/utils";
@@ -48,9 +48,7 @@ export function SplashScreen() {
useEffect(() => {
let cancelled = false;
void (async () => {
// 用 getLoginToken() 拿 string | null(不是 hasLoginToken() 拿 boolean
const r = await AuthStorage.getInstance().getLoginToken();
if (!cancelled && r.success && r.data) {
if (!cancelled && (await hasBusinessLoginToken())) {
router.replace(ROUTES.chat);
}
})();