feat(admin): sync and authorize Keycloak users
Generic Container CI/CD / test-build-publish (push) Successful in 1m5s
Frontend CI/CD v2 / build-test-publish-and-deploy (push) Successful in 1m5s

This commit is contained in:
2026-11-04 13:35:29 +08:00
parent 7f1ab4a79c
commit ca1c41aa9d
10 changed files with 1077 additions and 143 deletions
@@ -12,9 +12,11 @@ import { useAuthStore } from "@/store/authStore";
export const RoutePermissionGuard = ({
children,
authenticated,
accessDenied = false,
}: {
children: ReactNode;
authenticated: boolean;
accessDenied?: boolean;
}) => {
const pathname = usePathname();
const permissions = useAccessStore((state) => state.permissions);
@@ -37,6 +39,21 @@ export const RoutePermissionGuard = ({
);
}
if (accessDenied) {
return (
<Box sx={{ p: { xs: 2, md: 4 } }}>
<Alert severity="warning" icon={<LockOutlinedIcon />}>
<Stack spacing={0.5}>
<Typography fontWeight={700}>账号尚未获得访问权限</Typography>
<Typography variant="body2">
身份认证已成功,但当前账号尚未由系统管理员启用,或无权访问所选项目。请联系系统管理员完成授权后重试。
</Typography>
</Stack>
</Alert>
</Box>
);
}
if (requiredPermission && loading) {
return (
<Box sx={{ minHeight: 320, display: "grid", placeItems: "center" }}>