# eauth-console **Repository Path**: efucloud/eauth-console ## Basic Information - **Project Name**: eauth-console - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-09-16 - **Last Updated**: 2026-09-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # EAuth Console(易认证前端) [中文](./README.md) | [English](./README.en.md) EAuth Console 是 [EAuth](https://github.com/efucloud/eauth) 统一认证平台的 Web 控制台,提供登录、授权、用户与应用管理、第三方身份源配置以及个人安全设置等界面。 > 本仓库只包含前端代码。后端服务、容器镜像和 Kubernetes 部署清单位于 [efucloud/eauth](https://github.com/efucloud/eauth)。 ## 功能 - 用户名、邮箱、手机号及人脸识别登录 - OAuth 2.0 / OpenID Connect 授权与回调页面 - OIDC 第三方身份源配置 - 用户、应用及回调地址管理 - MFA、个人资料与密码设置 - 认证数据仪表盘 - 中英文界面和基于角色的页面权限 ## 技术栈 - React 18 - TypeScript - Umi Max 4 - Ant Design 5 / Ant Design Pro Components - npm(唯一支持的包管理器) ## 本地开发 ### 环境要求 - Node.js 22 或更高版本 - npm 10 或更高版本 - 已在 `http://localhost:9001` 运行的 [EAuth 后端](https://github.com/efucloud/eauth) ### 启动 ```bash git clone https://github.com/efucloud/eauth-console.git cd eauth-console npm ci --legacy-peer-deps npm run start:dev ``` 打开 `http://localhost:8000`。开发服务器会把下列请求代理到后端: - `/api` - `/public` - `/face-recognition` - `/.well-known/openid-configuration` 代理目标在 [`config/proxy.ts`](./config/proxy.ts) 中配置。若后端地址不是 `http://localhost:9001`,请修改该文件后重新启动开发服务器。 ### 默认管理员 后端首次启动时会创建以下管理员: - 用户名:`admin` - 密码:`EfuCloud` 请在生产环境部署前修改默认密码。 ## 常用命令 | 命令 | 说明 | | ----------------------- | ------------------------------- | | `npm run start:dev` | 启动本地开发服务器,不启用 Mock | | `npm run build` | 构建生产静态文件到 `dist/` | | `npm run preview` | 构建并在本地预览 | | `npm run lint` | 检查 ESLint 与 Prettier | | `npm run tsc` | 执行 TypeScript 类型检查 | | `npm test` | 运行 Jest 测试 | | `npm run test:coverage` | 运行测试并生成覆盖率报告 | ## 生产构建与部署 ```bash npm ci --legacy-peer-deps npm run build ``` 构建结果位于 `dist/`,可部署到任意静态 Web 服务器。生产环境的 Web 服务器需要: 1. 对单页应用启用回退规则,将未匹配的页面路由返回 `index.html`。 2. 将 `/api/`、`/public/`、`/face-recognition/` 和 `/.well-known/openid-configuration` 反向代理到 EAuth 后端。 3. 使用 HTTPS,尤其是在启用人脸识别或部署 OAuth/OIDC 回调时。 仓库中的 `Dockerfile.local` 会把已生成的 `dist/` 打包进 Nginx 镜像;它不会在镜像内执行前端构建: ```bash npm run build docker build -f Dockerfile.local -t eauth-console:local . ``` 完整的 Nginx 配置和 Kubernetes 示例请参考后端仓库的 [`docs/frontend.yaml`](https://github.com/efucloud/eauth/blob/main/docs/frontend.yaml)。 ## 项目结构 ```text config/ Umi 配置、路由和开发代理 public/ 静态资源 src/components/ 通用组件 src/locales/ 中英文文案 src/pages/ 页面与授权流程 src/services/ 后端 API 客户端和类型 ``` ## 相关项目 - 后端:[efucloud/eauth](https://github.com/efucloud/eauth) - 集群部署:[EAuth Kubernetes 部署说明](https://github.com/efucloud/eauth/blob/main/docs/README.md) ## 许可证 本项目基于 [Apache License 2.0](./LICENSE) 开源。