Files
cms-front/README.md
2026-02-03 17:34:55 +08:00

30 lines
804 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# cms-front
CMS 前端(业务系统),用于演示按 `iam-service/docs/SSO_INTEGRATION.md` 接入统一登录iam-front
## 本地启动
```bash
cp .env.example .env
pnpm install
pnpm dev
```
## 本地联调流程
- 未登录访问页面时middleware 会跳转到 iam-front 的 `/login`(携带 `clientId/tenantId/callback`
- 登录成功后会回跳到业务 callback通常是 `cms-service /auth/callback`),由后端换 token 并写入 cookie然后再重定向回 cms-front
- 换取失败会跳转到 `/auth-error` 显示错误信息
开发环境设置 tenantId写入 tenantId cookie
```
/api/dev/set-tenant?tenantId=你的租户UUID
```
也可以在 .env 里设置默认租户(仅开发环境生效):
```
CMS_DEFAULT_TENANT_ID=你的租户UUID
```