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
+6 -12
View File
@@ -138,7 +138,7 @@ Page(withDataCache(withListPagination({
if (!ticket) return;
try {
var self = this;
var albumId = this.data.albumId;
var albumId = /^-\d+$/.test(String(this.data.albumId)) ? null : this.data.albumId;
if (!albumId) {
var albums = itemsOf(await api.albumList({page:1,page_size:1}));
if (albums && albums.length > 0) {
@@ -322,18 +322,11 @@ Page(withDataCache(withListPagination({
await requestSubscribeAfterAction('photo');
try {
// 上传前先预热 session,确保认证状态有效
// 解决 Android 端首次上传时 session 未初始化的问题
try {
wx.showLoading({ title: '准备中...', mask: true });
await api.checkAuth();
wx.hideLoading();
} catch (e) {
wx.hideLoading();
console.warn('Session 预热失败(不影响后续上传)', e);
var albumId = /^-\d+$/.test(String(this.data.albumId)) ? null : this.data.albumId;
if (!albumId) {
const albums = itemsOf(await api.albumList({ page: 1, page_size: 1 }));
albumId = albums.length ? albums[0].id : null;
}
var albumId = this.data.albumId;
if (!albumId) {
wx.showLoading({ title: '创建相册...' });
var album = await api.albumAdd({ title: '默认相册', description: '我们的甜蜜照片' });
@@ -341,6 +334,7 @@ Page(withDataCache(withListPagination({
this.setData({ albumId: albumId });
wx.hideLoading();
}
this.setData({ albumId: albumId });
var batchId = Date.now().toString();
// 自动定位:为未填写位置的照片自动获取地理位置(发布后自动显示)