feat: add account deletion, announcements and subscription renewal

Support personal records and persistent smoking visibility. Add upload quota preflight, file cleanup, privacy entry, image caching and revision-based page refresh across the backend, admin and mini program.
This commit is contained in:
2026-11-03 22:06:47 +08:00
parent 4c9708b562
commit 8be6d9b1ab
98 changed files with 1679 additions and 372 deletions
+10 -4
View File
@@ -1,3 +1,4 @@
const { tryLoginRenewal } = require('../../utils/subscribe');
const { uploadReference } = require('../../utils/file-media');
const { itemsOf, startList, current, mergeUnique, applyList, failList, finishList, withListPagination } = require('../../utils/list-pagination');
const { currentUserLocation } = require('../../utils/user-location');
@@ -6,9 +7,9 @@ const { withDataCache } = require('../../utils/page-cache');
const { getLayout } = require('../../utils/layout');
// pages/album/album.js - 日记式分组相册
const { api, getImageUrl, API_BASE, uploadFileCompat } = require('../../utils/request');
const { requestSubscribeAfterAction } = require('../../utils/subscribe');
const { guardStorageSpace } = require('../../utils/storage-guard');
Page(withDataCache(withListPagination({
onLoginSubscribeTap: function() { return tryLoginRenewal(); },
onResize: function() { this.setData(getLayout()); },
data: { loading: true, loadError: false,
batches: [],
@@ -317,9 +318,8 @@ Page(withDataCache(withListPagination({
var successCount = 0;
var failCount = 0;
var failReasons = [];
var quotaReached = false;
// ★ 在用户点击手势上下文中提前请求订阅消息(符合微信规范)
await requestSubscribeAfterAction('photo');
try {
var albumId = /^-\d+$/.test(String(this.data.albumId)) ? null : this.data.albumId;
@@ -372,6 +372,12 @@ Page(withDataCache(withListPagination({
failReasons.push('第' + (i+1) + '张: 上传返回无路径 - ' + JSON.stringify(uploadRes));
}
} catch (e) {
if (e && Number(e.code) === 10001) {
quotaReached = true;
failCount += paths.length - i;
wx.hideLoading();
break;
}
failCount++;
failReasons.push('第' + (i+1) + '张: ' + (e.error || e.errMsg || e.message || JSON.stringify(e)));
// 内容安全违规:明确提示用户
@@ -390,7 +396,7 @@ Page(withDataCache(withListPagination({
var msg = '上传完成 ' + successCount + '/' + paths.length;
if (failCount > 0) msg += '(' + failCount + '张失败)';
wx.showToast({ title: msg, icon: successCount > 0 ? 'success' : 'none', duration: 2000 });
if (!quotaReached) wx.showToast({ title: msg, icon: successCount > 0 ? 'success' : 'none', duration: 2000 });
// 如果有失败,输出详细原因到控制台
if (failCount > 0 && failReasons.length > 0) {