feat(平台端): 平台端只保留运营(operator)单一角色 — 去掉其它端口/角色入口

- rbac NAV「总览」由 8 端口开放改为仅 operator(平台端单一角色);其它端口(政务/企业/服务商/投资人/OPC/载体/开发者)不再作为平台端角色入口。
- 平台登录:多身份时仅展示 operator 身份(过滤其它端口),其余端口走各自端(园区账密等)入口。
- npm run build 通过。
This commit is contained in:
Pine
2026-08-24 18:29:41 +08:00
parent 25ab5b969c
commit caeaadfed0
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ export interface NavGroup {
export const NAV: NavGroup[] = [
{
items: [
{ to: "/", label: "总览", icon: LayoutDashboard, roles: ["operator", "government", "enterprise", "carrier", "provider", "investor", "opc", "developer"] },
// 平台端只保留运营(operator)单一角色;其它端口(政务/企业/服务商/投资/OPC/载体等)不作为平台端角色入口
{ to: "/", label: "总览", icon: LayoutDashboard, roles: ["operator"] },
],
},
{
+3 -2
View File
@@ -43,8 +43,9 @@ export default function LoginPage() {
setLoading(true);
try {
const res = await login(username, password);
// 多身份:进入身份选择
if (res && res.identities.length > 1) setPendingIds(res.identities);
// 平台端只保留运营(operator)单一角色:过滤其它端口身份(政务/企业/载体/服务商等)
const operatorIds = (res?.identities ?? []).filter((i) => i.role === "operator");
if (operatorIds.length > 1) setPendingIds(operatorIds);
else navigate("/", { replace: true });
} catch (err) {
setError(err instanceof Error ? err.message : "登录失败");