From 1e550aaa8a79f4795c12d3295a9b09e6c986f49f Mon Sep 17 00:00:00 2001 From: Pine Date: Mon, 24 Aug 2026 18:32:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B9=B3=E5=8F=B0=E7=AB=AF):=20=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=99=BB=E5=BD=95=E6=B8=85=E9=99=A4=E5=9B=AD=E5=8C=BA?= =?UTF-8?q?=E7=AB=AF=E7=99=BB=E5=BD=95=E6=80=81=20=E2=80=94=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=99=BB=E5=BD=95=E5=8F=AA=E8=A7=81=E5=9B=AD=E5=8C=BA?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 平台登录时 clearParkAuth,避免残留园区账密登录态被 isParkUser 劫持回 /park,导致只见园区管理 而看不到完整运营(用户/培训业务/算力)+园区管理。operator 导航含全部,npm run build 通过。 --- src/pages/login/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index f7107ea..b1c4cac 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { useNavigate, Navigate } from "react-router-dom"; import { useAuth } from "@/lib/auth"; -import { parkLogin, isParkUser } from "@/lib/parkAuth"; +import { parkLogin, isParkUser, clearParkAuth } from "@/lib/parkAuth"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; @@ -42,6 +42,8 @@ export default function LoginPage() { setError(null); setLoading(true); try { + // 平台登录:清除园区端(园区账密)登录态,避免被 isParkUser 劫持回 /park + clearParkAuth(); const res = await login(username, password); // 平台端只保留运营(operator)单一角色:过滤其它端口身份(政务/企业/载体/服务商等) const operatorIds = (res?.identities ?? []).filter((i) => i.role === "operator");