feat: add WeChat Pay, Redis logging, storage tiers and personal albums

Replace virtual payments with WeChat Pay API v3 and verify callbacks and order polling. Cache WeChat access tokens in Redis and write structured Zap logs. Support configurable capacity plans across the API, admin and mini program, with purchase snapshots and quota enforcement. Allow personal albums before binding and share them with the current partner. Update deployment configuration and domain routing.
This commit is contained in:
2026-11-02 23:40:49 +08:00
parent 4934a69581
commit 4c9708b562
69 changed files with 2692 additions and 1153 deletions
+5 -5
View File
@@ -2,12 +2,12 @@
// 存储空间统一拦截:上传照片/图片前检查剩余空间,超出时在按钮处直接阻止上传。
const { api } = require('./request');
// 判断是否超出配额(会员无限空间,不拦截)
// 只有无限容量套餐免配额检查,付费有限套餐同样需要校验。
function quotaExceeded(d, extraBytes) {
if (!d) return false;
const isVip = d.is_vip || d.isVip;
if (isVip) return false;
const free = d.free_bytes || d.freeBytes || 0;
const unlimited = d.is_unlimited || d.isUnlimited;
if (unlimited) return false;
const free = d.quota_bytes != null ? d.quota_bytes : (d.quotaBytes != null ? d.quotaBytes : (d.free_bytes || d.freeBytes || 0));
const used = d.used_bytes || d.usedBytes || 0;
return used + (extraBytes || 0) > free;
}
@@ -16,7 +16,7 @@ function quotaExceeded(d, extraBytes) {
function showQuotaBlocked() {
wx.showModal({
title: '存储空间不足',
content: '当前存储空间已满,请升级为无限空间会员后再上传照片。',
content: '当前存储空间已满,请选择更大容量的套餐后再上传照片。',
confirmText: '去升级',
cancelText: '取消',
success: function (res) {