peanut
|
0669af0203
|
fix(login): remove profile check, always redirect to script page after login
|
2026-06-04 00:22:44 +08:00 |
|
peanut
|
8ded0cc3ad
|
docs: add login route fix design spec
|
2026-06-04 00:17:55 +08:00 |
|
peanut
|
e23eb32c1d
|
test: 集成测试验证 RestTemplate 运行时 User-Agent 为 Mozilla/5.0
|
2026-06-03 23:46:03 +08:00 |
|
peanut
|
2413b2bf58
|
feat(exception): GlobalExceptionHandler 新增 WechatApiException handler
解决问题:
- WechatApiException 抛出后未统一处理,会冒泡到 Spring 默认错误页(500 HTML)
- 前端拿不到结构化错误信息
改动:
- 新增 @ExceptionHandler(WechatApiException.class) 方法
- code=400 -> Result.badRequest()(微信业务错误)
- code=502 -> Result.error(502, message)(上游/网络错误)
- 其他(code=500) -> Result.error(message)(内部 JSON 解析错误)
- 日志记录 code 和 message(已确保不含敏感信息)
- 风格与现有 BusinessException handler 保持一致
|
2026-06-03 23:24:44 +08:00 |
|
peanut
|
76d4d7465c
|
feat(wechat): 重写 code2Session 实现 5 步防御性处理
解决问题:
- 微信API返回 text/plain 时 JSONObject.parseObject 抛异常导致用户500
- 网络异常时 RestClientException 未被捕获
- 业务错误码(errcode != 0)未处理
实现 5 步防御:
1. 网络层:捕获 ResourceAccessException / RestClientException -> 502
2. HTTP 状态:手动检查 is2xxSuccessful(因 WechatResponseErrorHandler 让 4xx/5xx 不抛)-> 502
3. Content-Type:检查 isCompatibleWith(APPLICATION_JSON) -> 502
4. JSON 解析:try/catch 包裹 parseObject -> 500
5. 业务码:检查 errcode == 0 -> 400
TDD:先写 10 测试场景覆盖所有分支,再实现
- 正常 JSON 成功
- HTTP 4xx / 5xx
- Content-Type: text/plain / text/html
- JSON 解析失败
- 业务错误码 40029 / 40163
- 网络异常(ResourceAccessException)
- 响应缺少 session_key
|
2026-06-03 23:14:09 +08:00 |
|
peanut
|
012fa46d3a
|
feat(wechat): 重写 RestTemplateConfig 统一 RestTemplate Bean
解决问题:
- WAF 拦截 Java/17.0.x 默认 User-Agent
- 无超时设置(线程可能被 hang 住)
- 无请求/响应日志(出问题时无排查依据)
改动:
- 用 BufferingClientHttpRequestFactory 包装 SimpleClientHttpRequestFactory
(响应体缓存为字节数组,Interceptor/ErrorHandler/Converter 可多次读)
- 显式 User-Agent: Mozilla/5.0 (compatible; EmotionMuseum/1.0)
- 显式 Accept: application/json, text/plain, */*
- connect timeout 5s, read timeout 10s
- additionalInterceptors 加 WechatApiLoggingInterceptor(脱敏)
- additionalMessageConverters 加 StringHttpMessageConverter(UTF_8)
- errorHandler 用 WechatResponseErrorHandler(4xx/5xx 不抛)
兼容性:
- 7 个其他 RestTemplate 使用点(DifyProviderAdapter、
CozeProviderAdapter、HttpTtsEngineClient、AsrServiceImpl、
ApiEndpointServiceImpl、AiChatServiceImpl、ApiTestProxyController)
行为完全不变(BufferingClientHttpRequestFactory 兼容所有流式 API)
|
2026-06-03 22:46:30 +08:00 |
|
peanut
|
9c785a675c
|
feat(wechat): 新增 WechatResponseErrorHandler
- 继承 DefaultResponseErrorHandler
- 显式重写 hasError() 委托父类判断(4xx/5xx)
- handleError() 仅记录日志不抛异常
- 不在 handler 读 body(避免流消费,由 LoggingInterceptor 统一处理)
|
2026-06-03 22:39:20 +08:00 |
|
peanut
|
4452d0301c
|
feat(wechat): 新增 WechatApiLoggingInterceptor 拦截器(含脱敏单元测试)
- ClientHttpRequestInterceptor 实现
- URL/method/status/content-type 用 INFO 级别
- body 用 DEBUG 级别,MAX_BODY_LOG=2048 截断
- 脱敏正则覆盖 session_key/openid/unionid/access_token/refresh_token/secret/appsecret
- 配合 BufferingClientHttpRequestFactory 使用避免流被消费
- 4 个单元测试覆盖主要脱敏场景
|
2026-06-03 22:37:22 +08:00 |
|
peanut
|
35baa6c958
|
feat(wechat): 新增 WechatApiException 业务异常类
- 继承 RuntimeException
- code 字段使用 HTTP 风格状态码(400/500/502)
- rawBody 字段保留原始响应体用于排查
- 配套 Getter 由 Lombok @Getter 生成
|
2026-06-03 22:23:40 +08:00 |
|
peanut
|
070e7dfbd9
|
docs(plan): 微信小程序登录修复实施计划
8 个任务,TDD 风格,频繁 commit:
- Task 1: WechatApiException 异常类(30 行)
- Task 2: WechatApiLoggingInterceptor 拦截器 + 4 个脱敏单元测试(60 行)
- Task 3: WechatResponseErrorHandler 错误处理器(30 行)
- Task 4: 重写 RestTemplateConfig 统一 Bean(13 → 40 行)
- Task 5: 重写 code2Session 五步防御 + 8 个单元测试(49 → 90 行)
- Task 6: application.yml 移除 app-id/app-secret 硬编码(2 行)
- Task 7: GlobalExceptionHandler 新增 WechatApiException handler(+25 行)
- Task 8: 端到端验证(mvn + 部署 + H5 + 脱敏检查 + 回滚测试)
总计约 280 行 Java + 2 行 YAML。每个任务独立 commit 便于回滚。
执行方式:Subagent-Driven(用户已选)
依赖技能:superpowers:subagent-driven-development
|
2026-06-03 22:18:11 +08:00 |
|
peanut
|
82c308b40a
|
docs: 修复 spec 评审 Round 2 发现的 1 P0 编译错误 + 3 P2 一致性问题
P0 编译错误:
- MediaType.includesCompatibleWith() 不存在于 Spring Framework
改为 MediaType.APPLICATION_JSON.isCompatibleWith(contentType)
(避免实现阶段 mvn 编译直接阻塞)
P2 一致性:
- WechatResponseErrorHandler 类注释第 1 条错误('显式重写返回 true')
改为正确的 '委托父类 4xx/5xx 判断'
- hasError() 方法内联注释自相矛盾
改为正确的 '委托父类 DefaultResponseErrorHandler.hasError()'
- GlobalExceptionHandler.handleWechatApiException rawBody 日志未脱敏
(Interceptor 已脱敏响应 body,但 rawBody 字段在异常对象中再次传递会绕过脱敏)
新增 desensitizeForLog() 方法复用正则,覆盖 code 字段(authorization code 也需脱敏)
- 移除 @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
(与现有 BusinessException handler 不一致;HTTP 层统一返回 200,业务错误由 Result.code 表达)
|
2026-06-03 07:42:59 +08:00 |
|
peanut
|
13f773f3f0
|
docs: 修复 spec 评审 17 个问题(4 P0 阻塞 + 7 P1 重要 + 6 P2 次要)
P0(阻塞):
- BufferingClientHttpRequestFactory 解决响应体流被消费破坏其他 7 个使用点
- WechatApiException 显式 handler 避免泄露原始错误消息给前端
- LoggingInterceptor 脱敏 session_key/openid/unionid 解决敏感信息泄露
- WechatResponseErrorHandler 显式重写 hasError 避免流消费冲突
P1(重要):
- 包结构统一(LoggingInterceptor → interceptor 包,ErrorHandler → config 包)
- WechatApiException 用 HTTP 风格错误码(400/500/502)替代负数
- app-id/app-secret 一致性:都删除硬编码默认值
- WAF 验证改为后端日志验证 UA(不再用 Postman)
- 列出 7 个其他 RestTemplate 使用点逐一评估
P2(次要):
- body 日志改 DEBUG(生产 INFO 不打印)
- 统一 [WeChatAPI] 日志前缀便于 grep
- rawBody 不放在 DTO(保持纯 DTO)
- 增加回滚方案说明
|
2026-06-03 07:35:50 +08:00 |
|
peanut
|
5631f22566
|
docs: 修复微信小程序登录 text/plain 错误设计文档(WAF 拦截 + 凭据硬编码)
|
2026-06-03 07:28:30 +08:00 |
|
peanut
|
76bc979cfe
|
feat(tools): 添加服务器日志下载脚本
- 从生产服务器下载 emotion-single.log 到本地 logs/server/
- 自动创建目录、备份旧日志、显示文件大小信息
- 使用 scp 命令,依赖已配置的 SSH 免密登录
|
2026-06-03 00:08:14 +08:00 |
|
deploy-bot
|
820ff93dc7
|
test: 端到端验证 nginx 部署成功(7s 内完成,5 步骤全部通过)
|
2026-06-02 22:15:12 +08:00 |
|
deploy-bot
|
35834b121e
|
feat(deploy): 实现 enable_nginx_site 步骤 5(验证)+ 集成到 deploy_nginx
|
2026-06-02 22:08:59 +08:00 |
|
deploy-bot
|
b124fe78af
|
feat(deploy): 实现 enable_nginx_site 步骤 3(两段式建链)+ 步骤 4(清 default)
|
2026-06-02 22:07:05 +08:00 |
|
deploy-bot
|
a6df8dcb92
|
feat(deploy): 实现 enable_nginx_site 步骤 1(诊断)+ 步骤 2(清理)
|
2026-06-02 22:06:07 +08:00 |
|
deploy-bot
|
a649357650
|
feat(deploy): 添加 enable_nginx_site 函数骨架 + 变量安全校验
|
2026-06-02 22:04:30 +08:00 |
|
deploy-bot
|
a277a7325f
|
docs: 添加 nginx 站点启用超时修复实施计划
|
2026-06-02 21:58:49 +08:00 |
|
deploy-bot
|
85ba685bba
|
docs: 修复 spec 评审 3 发现的 3 个问题(步骤 3 两段式、domain 结构校验、步骤 4 warning+步骤 5 验证 default)
|
2026-06-02 21:52:04 +08:00 |
|
deploy-bot
|
78e97f6fee
|
docs: 修复 spec 评审 7 个问题(test 命令、失败短路、变量校验等)
|
2026-06-02 21:43:57 +08:00 |
|
deploy-bot
|
f6b3ba2d8c
|
docs: 添加 nginx 站点启用超时修复设计文档
|
2026-06-02 21:41:07 +08:00 |
|
peanut
|
2189ed24e6
|
docs: refine wechat auth design and plan
|
2026-05-31 23:37:02 +08:00 |
|
peanut
|
280c3d5e7d
|
docs: add mini program wechat auth implementation plan
|
2026-05-31 23:28:36 +08:00 |
|
peanut
|
9f829acb0e
|
docs: add mini program wechat auth design
|
2026-05-31 23:22:25 +08:00 |
|
peanut
|
094953f1c3
|
feat: 小程序页面优化和新增剧本库功能
|
2026-05-30 20:53:18 +08:00 |
|
peanut
|
acca1d84f3
|
fix: web-admin AI 配置 API 接口调整
|
2026-05-26 20:50:28 +08:00 |
|
peanut
|
d09f600751
|
feat: 小程序剧本、个人信息页、AI 运行时及 TTS 服务优化
|
2026-05-26 20:50:20 +08:00 |
|
peanut
|
a51d225897
|
feat: life-script AI 运行时和视图优化
|
2026-05-26 20:50:05 +08:00 |
|
peanut
|
c289097ca0
|
feat: TTS 服务功能完善(任务管理、配置优化、客户端实现)
|
2026-05-26 20:49:58 +08:00 |
|
peanut
|
2d7776dd4d
|
docs: 如愿星球小程序修改需求整理文档
|
2026-05-26 20:45:53 +08:00 |
|
peanut
|
613e8ec3ff
|
feat: 详情弹窗用户信息改为昵称+ID格式
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-25 22:46:11 +08:00 |
|
peanut
|
436145a5c8
|
feat: 调用日志列表新增调用用户列
|
2026-05-25 22:38:54 +08:00 |
|
peanut
|
d2e449ec4c
|
feat: 日志保存时写入 userName 字段
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-25 22:34:29 +08:00 |
|
peanut
|
d818367a32
|
feat: 调用日志实体新增 userName 字段及数据库迁移脚本
|
2026-05-25 22:29:50 +08:00 |
|
peanut
|
e3e1903d93
|
docs: 调用日志列表增加用户字段实现计划
|
2026-05-25 21:45:43 +08:00 |
|
peanut
|
763e1df662
|
docs: 调用日志列表增加用户字段设计文档
|
2026-05-25 20:52:05 +08:00 |
|
peanut
|
812e126b2b
|
refactor: 移除爽文页面我的剧本按钮和人生素材画像容器
移除我的剧本按钮(模板、样式、方法),用户可通过底部我的Tab查看剧本
移除人生素材画像容器组件(模板、样式、JS逻辑)
保留导入社交数据按钮及完整流程
useSocialInsights 改为默认 true,后端自动判断是否有可用画像
清理未使用的 socialImport 导入、confirmedInsights、loadConfirmedInsights 等
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 21:28:29 +08:00 |
|
peanut
|
ba196486c0
|
chore: 将后端运行时日志 backend.err 加入 gitignore
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 18:42:10 +08:00 |
|
peanut
|
84af570841
|
test: AI 流式服务单元测试
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 18:39:31 +08:00 |
|
peanut
|
fc14051073
|
feat: 小程序菜单按钮安全区域适配工具
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 18:39:28 +08:00 |
|
peanut
|
6e5a379bef
|
docs: 补充 AI 打字机输出、小程序灵感卡片、脚本主页布局等设计文档和计划
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 18:39:26 +08:00 |
|
peanut
|
886f04046b
|
feat: AI 流式服务完善、ProviderHttp 优化及 web-admin API 调整
- AiRuntimeServiceImpl: 流式输出逻辑优化,支持多 Provider 适配
- ProviderHttpSupport: HTTP 请求处理优化
- AiRoutingController: 新增日志查询接口
- AiCallLogService: 分页查询支持
- AiRuntimeRequest: 补充用户字段
- web-admin aiconfig API: 新增分页查询接口
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 18:35:56 +08:00 |
|
peanut
|
64476eee6d
|
feat: AI 打字机流式输出、小程序脚本主页布局及灵感卡片优化
- life-script: 新增 aiRuntime 打字机流式服务,PathView/ScriptView/TimelineView 接入打字机效果
- mini-program: ScriptView 重构为打字机输出 + 卡片式灵感列表,主页布局优化
- web: aiRuntime 服务新增流式输出支持
- chat store: 消息状态管理和打字机流式渲染支持
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 18:35:33 +08:00 |
|
peanut
|
c900f56174
|
feat: AI 调用日志详情查看功能完成
- 后端编译验证通过 (BUILD SUCCESS)
- 前端管理后台服务正常启动 (localhost:5174)
- AI配置管理 → 调用日志 Tab 验证通过:
- 筛选栏显示正常(状态、场景、服务商、接口、时间、关键词搜索)
- 分页数据正确加载(33条记录,20条/页)
- 表格行展开功能正常(入参/出参预览、错误信息)
- 详情弹窗显示完整(基本信息、入参JSON、出参内容、错误信息)
- JSON 格式化高亮显示正常
- 复制按钮功能正常
- 分页切换正常
- 浏览器 Console 无报错
|
2026-05-24 12:13:35 +08:00 |
|
peanut
|
e3edc319e8
|
feat: 调用日志 Tab 增加筛选栏、展开行、分页和详情弹窗
|
2026-05-24 11:56:33 +08:00 |
|
peanut
|
b4af9fc99b
|
feat: AI 调用日志 Service 分页查询和 Controller POST 接口
|
2026-05-24 11:49:15 +08:00 |
|
peanut
|
3888a40a5c
|
feat: 新增 JsonViewer 和 AiCallLogDetailDialog 组件
|
2026-05-24 11:48:07 +08:00 |
|
peanut
|
902068387b
|
feat: 添加 AI 调用日志查询参数类型和分页查询接口
|
2026-05-24 11:45:49 +08:00 |
|