feat(aihr): scope supervisor practice data
This commit is contained in:
+23
-12
@@ -8,10 +8,10 @@
|
||||
|
||||
## 本地端口
|
||||
|
||||
- 管理端前端:`http://127.0.0.1:5173/`
|
||||
- 管理端前端:`https://wygj-admin.localhost/`
|
||||
- 旧移动端前端:`http://127.0.0.1:5174/h5/user`
|
||||
- uni-app 用户侧:`https://wygj-mobile-uni.localhost/h5/`
|
||||
- 后端:`http://127.0.0.1:8080/`
|
||||
- 后端:`https://wygj-api.localhost/`,显式 `PORTLESS=0` 时回退 `http://127.0.0.1:8080/`
|
||||
- MySQL:`127.0.0.1:13306`,数据库 `ry-vue`,账号 `root/root`
|
||||
- Redis:`127.0.0.1:16379`,密码 `ruoyi123`
|
||||
- MinIO API:`http://127.0.0.1:9000`,Console:`http://127.0.0.1:9001`,账号 `ruoyi / ruoyi123`,默认 bucket `ruoyi`
|
||||
@@ -23,22 +23,30 @@
|
||||
本机开发测试优先用 portless 访问稳定域名,避免继续记固定端口:
|
||||
|
||||
- uni-app 用户侧:`https://wygj-mobile-uni.localhost/h5/`
|
||||
- 管理端:`https://wygj-admin.localhost/`
|
||||
- 后端 API:`https://wygj-api.localhost`
|
||||
|
||||
启动 uni-app 用户侧:
|
||||
从根目录一次性启动 portless 配置中的管理端和 uni-app 用户侧:
|
||||
|
||||
```bash
|
||||
portless
|
||||
```
|
||||
|
||||
portless 会按根目录 `portless.json` 执行 `mobile-uni` 的 `npm run dev`。旧 `./scripts/dev.sh` 仍会拉起 `mobile/` 作为演示兜底;新用户侧开发测试优先看 `wygj-mobile-uni.localhost`。
|
||||
|
||||
若后端已经由 `./scripts/dev-backend.sh` 启动在 `8080`,注册一次静态别名:
|
||||
portless 会按根目录 `portless.json` 执行 `frontend` 和 `mobile-uni` 的 `npm run dev`。后端由 `./scripts/dev.sh` 默认通过 `portless run --name wygj-api ./scripts/dev-backend.sh` 启动;如需单独启动后端,可执行:
|
||||
|
||||
```bash
|
||||
portless alias wygj-api 8080
|
||||
portless run --name wygj-api ./scripts/dev-backend.sh
|
||||
```
|
||||
|
||||
若已经通过 `./scripts/dev.sh` 启动管理端,只需要单独启动当前用户侧:
|
||||
|
||||
```bash
|
||||
cd mobile-uni
|
||||
portless run --name wygj-mobile-uni npm run dev
|
||||
```
|
||||
|
||||
旧 `./scripts/dev.sh` 仍会拉起 `mobile/` 作为演示兜底;后端开发测试优先看 `wygj-api.localhost`,管理端开发测试优先看 `wygj-admin.localhost`,新用户侧开发测试优先看 `wygj-mobile-uni.localhost`。
|
||||
|
||||
Qdrant 默认本地无需配置;远端或自定义 collection 可用 `AIHR_QDRANT_URL`、`AIHR_QDRANT_COLLECTION`、`AIHR_QDRANT_API_KEY` 覆盖。服务端资料导入根目录可用 `AIHR_IMPORT_ROOT` 或 `-Daihr.import.root` 覆盖。组织人员同步可用 `AIHR_ORG_SYNC_BASE_URL` 指向外部开放平台 `/api/open/v1` 前缀,并配置 `AIHR_ORG_SYNC_ACCESS_TOKEN` 或 `AIHR_ORG_SYNC_CLIENT_ID`/`AIHR_ORG_SYNC_CLIENT_SECRET`;业务请求会用 client secret 生成 HMAC-SHA256 hex 签名。移动端手机号登录的短信模板 ID、阿里云 AccessKey、Secret 和短信签名都通过环境变量注入;本地放根目录 `.env.local`,`scripts/dev-backend.sh` 会自动加载。若开放平台凭证放在 `backend/.env`,启动脚本也会加载该文件,并把 `client_id`/`client_secret` 映射为组织同步实际读取的 `AIHR_ORG_SYNC_CLIENT_ID`/`AIHR_ORG_SYNC_CLIENT_SECRET`。
|
||||
|
||||
本地 `.env.local` 示例:
|
||||
@@ -71,11 +79,14 @@ AIHR_AI_SPEECH_ENABLED=true
|
||||
在项目根目录执行:
|
||||
|
||||
```bash
|
||||
# 终端 1
|
||||
./scripts/dev.sh
|
||||
portless
|
||||
|
||||
# 终端 2
|
||||
cd mobile-uni && portless run --name wygj-mobile-uni npm run dev
|
||||
```
|
||||
|
||||
`./scripts/dev.sh` 启动后端、管理端和旧移动端兜底;`portless` 启动当前 `mobile-uni` 用户侧。
|
||||
`./scripts/dev.sh` 启动后端、管理端和旧移动端兜底;后端与管理端默认通过 portless 暴露为 `https://wygj-api.localhost/` 和 `https://wygj-admin.localhost/`,`portless` 启动当前 `mobile-uni` 用户侧。若要显式使用旧端口调试,可执行 `PORTLESS=0 ./scripts/dev.sh`,后端入口为 `http://127.0.0.1:8080/`,管理端入口为 `http://127.0.0.1:5173/`。
|
||||
|
||||
首次启动或需要重建本地 `ry-vue` MVP 数据库时执行:
|
||||
|
||||
@@ -110,8 +121,8 @@ portless
|
||||
- 视频(`.mp4/.mov/.avi/.mkv/.webm/.m4v`,≤500MB、≤60 分钟)只走资料处理中心批量导入(异步队列):ffmpeg 抽音轨分段调 asr 转写 + 抽关键帧调 vision 提取画面文字,合并后归类切片入库,片段带 `[mm:ss]` 时间戳;**依赖服务器安装 ffmpeg/ffprobe**(macOS `brew install ffmpeg`,Linux `apt install ffmpeg`)
|
||||
- 服务端目录导入接口为 `POST /api/knowledge/doc/import-local-task`,只读取导入根目录下的相对目录,后台逐文件复用同一上传解析链路;`POST /api/knowledge/doc/import-tasks/{id}/cancel` 可取消运行中任务;`POST /api/knowledge/doc/import-local` 保留为同步调试接口。
|
||||
- 启用 `aihr_model_config.category='vector'` 的模型配置后,上传会同步写入片段 embedding,并尽力 upsert 到 Qdrant;模型配置页可查看 Qdrant 维度、点数和片段向量数,并在维度不一致时重建索引;未配置或 Qdrant 不可用时只走 MySQL Fulltext/seed fallback,不影响检索。
|
||||
- 后端 `ruoyi-admin` 已完成 Maven 打包并启动在 `8080`
|
||||
- 前端依赖已安装,Vite 已启动在 `5173`
|
||||
- 后端 `ruoyi-admin` 已完成 Maven 打包,并通过 portless 暴露为 `https://wygj-api.localhost/`
|
||||
- 前端依赖已安装,Vite 已通过 portless 暴露为 `https://wygj-admin.localhost/`
|
||||
- 旧移动端兜底依赖已安装,Vite 可启动在 `5174`;当前用户侧由 portless 启动 `mobile-uni`,入口 `https://wygj-mobile-uni.localhost/h5/`
|
||||
- 移动端手机号登录页已接 `/resource/sms/code` 与 `/auth/mobile/sms-login`;未配置真实 `ALIYUN_SMS_ACCESS_KEY_ID`、`ALIYUN_SMS_ACCESS_KEY_SECRET`、`ALIYUN_SMS_SIGN_NAME`、`AIHR_SMS_LOGIN_TEMPLATE_ID` 时不会发送阿里云短信;手机号不存在时会自动注册为 `app_user`
|
||||
- 移动端员工端“开始训练”已复用 `/api/train/practice/start`、`/turn`、`/finish`;移动端请求需带登录返回的 `Authorization` 与 `clientid`;完成后主管端完训人数、“待复盘对练”计数、复盘列表、复盘详情、员工训练历史和能力画像会变化
|
||||
@@ -129,7 +140,7 @@ curl -fsS http://127.0.0.1:6333/
|
||||
|
||||
```bash
|
||||
TOKEN=<登录后 access_token>
|
||||
curl -fsS http://127.0.0.1:8080/api/knowledge/doc/vector-index-status -H "Authorization: Bearer $TOKEN"
|
||||
curl -fsS https://wygj-api.localhost/api/knowledge/doc/vector-index-status -H "Authorization: Bearer $TOKEN"
|
||||
```
|
||||
|
||||
## 线上移动端静态发布
|
||||
|
||||
Reference in New Issue
Block a user