Files
guilixu-admin/.workbuddy/memory/2026-07-16.md
赵忠林 c9e074366f =========== V3.0.1 ==========
- 稳定版
- 可以基于此版本作为其他项目的底座
2026-07-16 22:16:53 +08:00

64 lines
4.1 KiB
Markdown
Raw 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-16
## 续费扫码支付链路修复(前后端联动)
### 问题1小程序 pay 页扫码后误显"支付成功"
- 文件:`websopy-taro/src/passport/pay/index.tsx`
- 根因:`fetchDetail``subscription.status === 'active'` 判定已支付。但后端 `renewPay` 为了避免放弃支付导致服务中断,**故意保留** `status='active'`、仅设 `payStatus=0`
- 修复:判断改为 `payStatus === 1`;同时处理 `cancelled`/`expired` 状态。详见 `websopy-taro/.workbuddy/memory/2026-07-16.md`
### 问题2用户点"立即支付"后端返回"该订阅已激活"
- 文件:`/Users/gxwebsoft/JAVA/websopy-java/src/main/java/com/gxwebsoft/app/controller/AppSubscriptionController.java`
- 根因:`pay/{id}`line 339-341`mp-prepay`line 539-541两处拦截只看 `status='active'`,与上次 `mp-confirm` 同样的坑——续费的 `active+payStatus=0` 被误拦。
- 修复:两处拦截条件对齐 `mp-confirm`,改为 `status='active' && payStatus==1` 才拦截,放行续费的 `active+payStatus=0`
- commit`7c95f8e` (本地 main待 push + 服务器部署)。
### 关键规则(防回归)
判断"是否已支付"必须用 `payStatus`0=未支付 / 1=已支付),**不能**用 `status`(订阅生命周期 active/pending/expired/cancelled。续费场景下这两个字段完全解耦后端 `renewPay` 保留 `status='active'` + 设 `payStatus=0`
后端三处拦截条件现在全部对齐:
- `pay/{id}` line 339-343
- `mp-prepay` line 541-545
- `mp-confirm` line 573之前已修
### 部署待办(用户操作)
1. 后端:`cd /Users/gxwebsoft/JAVA/websopy-java && git push`,然后远程服务器 `git pull && mvn clean package -DskipTests && docker-compose up -d --build cms-api`(或对应重启方式)。
2. 小程序端:`websopy-taro` 重新编译上传体验版/正式版。
3. 联调验证admin 点"立即续费" → 弹码 → 微信扫码 → 进小程序应显示"确认支付"页(不再误显成功)→ 点"立即支付" → 微信支付 → 显示"支付成功" → 跳转 `/user/apps/index`
## 商城后台 Dashboard 布局调整
- 文件:`src/views/shop/dashboard/index.vue`
- 需求:今日数据概况页,「基本信息」改为左右两列并排;删除「快捷操作」面板。
- 改动:
- `a-descriptions``:column="1"` 改为 `:column="{ xs: 1, sm: 2 }"`(响应式两列并排)。
- 基本信息 `a-col``:span="12"` 改为 `:span="24"`(占满整行)。
- 删除「快捷操作」`a-col` 整块并清理其专属的图标导入ShoppingCartOutlined/ShopOutlined/AppstoreOutlined/GiftOutlined/TeamOutlined/SettingOutlined/ClearOutlined`removeSiteInfoCache` 导入及 `handleClearCache` 函数。
### 今日数据概况 + 基本信息改为左右两栏布局
- 需求:参考「待处理事项 + 快速入口」的左右结构,将「今日数据概况」和「基本信息」也并排为左右各半。
- 改动:
- 原来各自独占整行的两个 panel合并到一个 `<a-row>` 中,各占 `:md="12"`
- 今日数据概况栅格从 4 列改为 2 列(`grid-template-columns: repeat(2, 1fr)`),适配半宽空间。
- 基本信息 `a-descriptions` 列数改为 `:column="1"`,半宽下单列更不拥挤。
- 基本信息(左)和今日数据概况(右)位置对调,基本信息在左、今日数据概况在右。
### 刷新统计数据修复
- 问题:点「刷新数据」按钮提示成功,但实际数据没更新。
- 根因:`refreshStatistics` 调用 `statisticsStore.fetchStatistics()` 未传 `forceRefresh=true`5分钟缓存有效期内直接返回旧数据。
- 修复:改为 `fetchStatistics(true)` 强制跳过缓存。
## README.md 修改
- 项目名称从"WebSoftAdmin"改为"小程序商城后台管理系统"。
- 项目域名更新为 https://shop.websoft.top。
- 去掉 CMS 内容管理系统的介绍部分(文章管理、一键排版、媒体库等)。
- 更新技术栈版本号对齐 package.jsonAntDv 4.x、Vite 8.x、TS 5.x、Pinia 2.x
- 补充门店/经销商/会员管理等商城核心功能描述,对齐实际 views/shop 目录结构。