You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.0 KiB
3.0 KiB
boot-verify:本地起后端(连远程 DB)操作记录(票 03,20260828)
启动方式(已验证可用)
# 仓库根目录执行;日志落 logs/crm-app.log
$env:SPRING_PROFILES_ACTIVE = 'verify'
java -jar crm-app\target\crm-app-1.0.0-SNAPSHOT.jar
- 无需任何环境变量:
application.yml的 env 兜底值即远程中间件(DB / Redis / MinIO 均8.129.84.155)。 verifyprofile 必开:DebugTokenController是@Profile("verify"),不开则/api/auth/debug/token404。- 用现成 fat jar 即可:
crm-app-1.0.0-SNAPSHOT.jar(117MB,2026-08-27 10:31 构建)比对全部模块源码 mtime 更新,无需重编译;源码变更后需重打:tmp\apache-maven-3.9.9\bin\mvn.cmd -pl crm-app -am package -DskipTests。 - JDK 17.0.15(本机 java 直接可用)。
启动日志要点(2026-08-28 09:58:46 → 09:59:22)
Started CrmAppApplication in 25.062 seconds,Tomcat 8080;- profile:
The following 1 profile is active: "verify";DebugTokenController 启用横幅出现; - 远程 MySQL 连通(HikariPool start completed);初始化器全绿:权限种子、字典权限(10 权限点)、线索/商机规则菜单、行政区划对账 3432 行、方案卡字段库 16 个、兜底模板 OPP_STAGE_TPL_01 / OPP_SCHEME_TPL_01 均已存在、字典 22 组。
冒烟结果(.scratch/opportunity-e2e/smoke.ps1,3 轮全过)
| 步骤 | 请求 | 结果 |
|---|---|---|
| 1 | GET /api/auth/debug/token?userId=739564171091247104 |
✅ data 为明文 JWT 字符串(177 字符) |
| 2 | GET /api/auth/me + Bearer |
✅ 200,success=true,用户 罗伟健 |
| 3 | POST /api/opportunity/page(form:viewType=MINE&pageNum=1&pageSize=2) |
✅ 200,success=true,total=26(存量含 sm-e2e、端到端回归 等) |
smoke.ps1 用法:powershell -NoProfile -ExecutionPolicy Bypass -File .scratch\opportunity-e2e\smoke.ps1 [userId]。
坑与观察
- ⚠ MinIO 凭据无效(不阻塞商机主流程):启动时
MinioConfig - MinIO bucket [crm] 初始化失败:The Access Key Id you provided does not exist in our records.(默认 minioadmin/minioadmin 与远程不匹配)。影响:文件上传/缩略图类接口在票 07 实测附件流程前需要用户先提供CRM_MINIO_AK/CRM_MINIO_SK环境变量再重启。 - 一次性 401(已定位为客户端因素):首个 POST 用
Invoke-RestMethod未显式 Content-Type 时出现过一次 401;改用Invoke-WebRequest+ 显式application/x-www-form-urlencoded后 3/3 稳定通过。401 无业务日志(Security 链/拦截器直接写响应)。纪律:E2E 脚本(票 07/08)统一显式 Content-Type;遇孤立 401 先重试一次再判缺陷。 - 服务现状:后端正在后台终端运行中(terminal_id=1);重启 = 杀进程后重跑启动命令。
- 页面接口形态备忘:
POST /api/opportunity/page,form 绑定OpportunityPageParam,六视图枚举RECENT/MINE/PARTICIPATED/FOLLOWED/MANAGE/PUBLIC_POOL。