fix(平台端): 平台登录清除园区端登录态 — 修复登录只见园区管理
平台登录时 clearParkAuth,避免残留园区账密登录态被 isParkUser 劫持回 /park,导致只见园区管理 而看不到完整运营(用户/培训业务/算力)+园区管理。operator 导航含全部,npm run build 通过。
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user