chore(dev): run mobile uni through portless

This commit is contained in:
2026-07-09 14:52:34 +08:00
parent 1c47e250c4
commit 54b2b0dbbc
5 changed files with 40 additions and 27 deletions
@@ -115,7 +115,7 @@ mobile-uni/
- 本机开发入口已切到 portless: `https://wygj-mobile-uni.localhost/h5/`。
- README 和本地运行手册已对齐新用户侧工程: `mobile-uni/` 作为当前施工/测试入口,旧 `mobile/` 仅保留为 MVP 演示兜底;线上 H5 发布命令改为同步 `mobile-uni/dist/build/h5/`。
- 演示验收和 API 对接文档已切到 `mobile-uni` 路由;`scripts/demo-check.sh` 的移动端预检默认检查 `https://wygj-mobile-uni.localhost/h5/` 与新工程 marker,不再用旧 `mobile/src/App.vue` 证明当前用户侧。
- 快速启动口径已补齐: `./scripts/dev.sh` 明确只启动后端、管理端和旧移动端兜底,当前用户侧由 `portless` 启动;脚本输出同步提示 `wygj-mobile-uni.localhost`。
- 快速启动口径已补齐: `./scripts/dev.sh` 默认通过 portless 启动后端、管理端和当前 `mobile-uni` 用户侧;旧移动端兜底只在 `PORTLESS=0` 固定端口调试时启动。
- 主管端已接入最小复盘闭环: 团队概览、待复盘列表、复盘详情、标记已复盘。
- 候选人端已接入最小闭环: 候选首页、结构化面试、最近面试记录、补充资料列表、文件上传、审核状态展示。
- 主管到员工的训练闭环已接入: 主管指派专项、员工今日任务、每日三题提交与反馈。
+8 -13
View File
@@ -26,26 +26,25 @@
- 管理端:`https://wygj-admin.localhost/`
- 后端 API:`https://wygj-api.localhost`
从根目录一次性启动 portless 配置中的管理端和 uni-app 用户侧:
从根目录一次性启动本地依赖、后端、管理端和 uni-app 用户侧:
```bash
portless
./scripts/dev.sh
```
portless 会按根目录 `portless.json` 执行 `frontend` 和 `mobile-uni` 的 `npm run dev`。后端由 `./scripts/dev.sh` 默认通过 `portless run --name wygj-api ./scripts/dev-backend.sh` 启动;管理端 Vite 代理读取 `frontend/.env.development` 的 `VITE_APP_PROXY_TARGET=https://wygj-api.localhost`,`mobile-uni` Vite 代理默认指向 `https://wygj-api.localhost`,都不依赖固定 `8080`。如需单独启动后端,可执行:
`./scripts/dev.sh` 默认通过 portless 启动后端、管理端和 `mobile-uni`,并由 Docker 启动 MySQL/Redis/MinIO/Qdrant。管理端 Vite 代理读取 `frontend/.env.development` 的 `VITE_APP_PROXY_TARGET=https://wygj-api.localhost`,`mobile-uni` Vite 代理默认指向 `https://wygj-api.localhost`,都不依赖固定 `8080`。如需单独启动后端,可执行:
```bash
portless run --name wygj-api ./scripts/dev-backend.sh
```
若已经通过 `./scripts/dev.sh` 启动管理端,只需要单独启动当前用户侧:
也可以只让 portless 按根目录 `portless.json` 启动前端工程:
```bash
cd mobile-uni
portless run --name wygj-mobile-uni npm run dev
portless
```
旧 `./scripts/dev.sh` 仍会拉起 `mobile/` 作为演示兜底;后端开发测试优先看 `wygj-api.localhost`,管理端开发测试优先看 `wygj-admin.localhost`,新用户侧开发测试优先看 `wygj-mobile-uni.localhost`。
旧 `mobile/` 只在显式 `PORTLESS=0 ./scripts/dev.sh` 时作为固定端口兜底启动;后端开发测试优先看 `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`。
@@ -79,14 +78,10 @@ AIHR_AI_SPEECH_ENABLED=true
在项目根目录执行:
```bash
# 终端 1
./scripts/dev.sh
# 终端 2
cd mobile-uni && portless run --name wygj-mobile-uni npm run dev
```
`./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/`。
`./scripts/dev.sh` 默认通过 portless 暴露后端、管理端和当前 `mobile-uni` 用户侧。若要显式使用旧端口调试,可执行 `PORTLESS=0 ./scripts/dev.sh`,后端入口为 `http://127.0.0.1:8080/`,管理端入口为 `http://127.0.0.1:5173/`,旧移动端兜底入口为 `http://127.0.0.1:5174/h5/user`。
首次启动或需要重建本地 `ry-vue` MVP 数据库时执行:
@@ -123,7 +118,7 @@ cd mobile-uni && portless run --name wygj-mobile-uni npm run dev
- 启用 `aihr_model_config.category='vector'` 的模型配置后,上传会同步写入片段 embedding,并尽力 upsert 到 Qdrant;模型配置页可查看 Qdrant 维度、点数和片段向量数,并在维度不一致时重建索引;未配置或 Qdrant 不可用时只走 MySQL Fulltext/seed fallback,不影响检索。
- 后端 `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/`
- 当前用户侧由 `./scripts/dev.sh` 通过 portless 启动 `mobile-uni`,入口 `https://wygj-mobile-uni.localhost/h5/`;旧移动端兜底仅在 `PORTLESS=0` 调试时启动到 `5174`
- 移动端手机号登录页已接 `/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`;完成后主管端完训人数、“待复盘对练”计数、复盘列表、复盘详情、员工训练历史和能力画像会变化
- 移动端候选人端“开始面试/面试练习”已复用 `/api/recruit/interview/start`、`/answer`、`/finish`;“补充资料”需带移动端 `Authorization` 与 `clientid`,上传后写 `sys_oss` 和 `aihr_candidate_material`,管理端 `/recruit/interview` 可审核为 `已通过/已驳回`