aurask/protal/README.md
Aaron c2fc63f5f1
All checks were successful
aurask-release / build-and-deploy (push) Successful in 1m56s
feat: add bilingual portal signin flow
2026-04-19 23:15:04 +08:00

60 lines
1.7 KiB
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.

# Aurask Protal
`protal/` 是 Aurask 用户门户目录,目录名按既定要求保留为 `protal`
## 当前能力
- 未登录用户访问 `/signin` 时展示 Aurask 自有登录页
- 登录卡片右上角支持 `EN / 中文` 语言切换
- 首次访问默认读取浏览器语言:
- `navigator.language``zh` 开头时默认中文
- 其他情况默认英文
- 用户手动切换语言后会写入 `localStorage`
- 语言范围覆盖 Aurask 自有门户界面:
- `/signin`
- 登录后的 `/app` 工作台壳层
- 嵌入的 `Langflow` / `AnythingLLM` 保持其自身语言,不做翻译
## Google 登录行为
- 门户继续使用 `GET /auth/config` 返回的 Google 配置
- 只有同时满足以下条件时才会挂载真实 Google 按钮:
- `auth.google.enabled === true`
- `auth.google.client_id` 有效
- Google GSI SDK 已加载完成
- 在配置缺失或 SDK 未就绪前,页面始终展示灰色禁用按钮
- 禁用按钮不可点击,并通过辅助文案提示当前状态
- 新用户首次成功登录后,后端仍会自动创建独立 workspace
## 本地存储键
- `aurask.portal.session`:登录会话令牌
- `aurask.portal.activeTab`:当前工作台标签
- `aurask.portal.locale`:门户语言选择
## 依赖接口
- `GET /auth/config`
- `POST /auth/google/login`
- `GET /auth/session`
- `POST /auth/logout`
## 部署假设
- 生产门户地址:`https://aurask.xyz`
- 生产 API 地址:`https://aurask.xyz/api`
- Langflow iframe`https://aurask.xyz/runtime/langflow/`
- AnythingLLM iframe`https://aurask.xyz/runtime/anythingllm/`
本地调试时会自动回退到:
```text
http://127.0.0.1:8080
```
## 静态资源
- `protal/index.html`
- `protal/main.js`
- `protal/styles.css`