Files
websopy-taro/.workbuddy/memory/2026-07-01.md
赵忠林 1d5bb5b9b1 feat(pay): 优化小程序支付流程并增强日志调试
- 更新 wx-login 接口以返回完整 LoginResult,包括 access_token 和 user 对象
- 支付页面新增大量日志,详尽打印参数、请求和响应信息
- 优化获取订阅详情流程,支持 returnRaw 返回完整响应用于调试
- 支付流程新增步骤,先通过 code 获取 openid 并缓存,再尝试用 openid 自动登录
- 增加自动登录失败交互,提示未注册用户先登录
- 支付相关请求均使用 returnRaw 方便错误排查
- request 请求模块添加统一请求和响应日志,增强调试能力
- request 认证错误和业务错误时加入详细日志输出
2026-07-02 16:01:39 +08:00

15 lines
1.0 KiB
Markdown
Raw Permalink 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.

# 2026-07-01 工作日志
## 修复支付页面 request URL 无效问题
- **文件**: `src/utils/request.ts`
- **问题**: 扫码进入支付页后报错 `request:fail invalid url "/app/subscription/detail-by-no/..."`,原因是核心 `request()` 函数没有调用 `buildUrl()` 拼接 baseUrl相对路径直接传给微信 `wx.request()` 导致失败
- **修复**: 在 `request()` 函数中统一加 `buildUrl(options.url)` 处理,确保所有请求方式都能正确拼接完整 URL
## 小程序码改为体验版
- **文件**: `src/api/invite/index.ts`(前端)
- **修改**: `generateMiniProgramCode` 函数将 `envVersion` 作为查询参数传给后端,默认值 `'trial'`
- **后端配合**:
- `WxLoginController.java`: `getOrderQRCodeUnlimited``getOrderQRCode` 方法新增 `@RequestParam(defaultValue = "release") String envVersion` 参数
- 硬编码的 `"release"` 改为动态读取 `envVersion` 参数
- `getQRCodeText` 已有此参数,无需修改
- **注意**: 提审上线前需将前端默认 `envVersion` 改回 `'release'`