feat(security): 三端闭环加固 + 微信提现打款/订阅消息落地

后端: 身份与归属鉴权收口; 资金安全(结算闸门/支付防篡改/报名费真实扣款/赠金/结算唯一入账/提现打款); 数据泄露与隐私; 登录与密钥安全(默认密钥闸门/登录限流); 可观测性; 启动自检.

微信: 商家转账到零钱提现打款闭环(含回调/查单/失败退回佣金); 订阅消息真实下发闭环与后台模板字段对齐.

后台: 财务/微信支付配置读取失败锁定; 看板/待办/走势去假数据; 打款与测试推送文案修正.

小程序: 请求层错误透传与登录过期提示; 多页失败反馈与乐观回滚; 帮助中心FAQ页面化.

测试: 新增 40+ 回归护栏与真实 MySQL 冒烟(75 套件/599 用例全绿).
这个提交包含在:
xcbyy
2026-10-17 18:00:09 +08:00
父节点 78117bb4e1
当前提交 2599dce315
共有 70 个文件被更改,包括 3806 次插入 和 330 次删除

查看文件

@@ -446,7 +446,20 @@ const toggleLike = async () => {
}
uni.setStorageSync('ACTIVE_COMMUNITY_POST', post.value);
} catch (err) {
// 回滚乐观更新,避免"已点赞"却未落盘
console.warn('[PostDetail] 点赞同步异常:', err.message);
post.value.liked = !willLike;
post.value.likes = Math.max(0, (Number(post.value.likes) || 0) + (willLike ? -1 : 1));
let revertIds = uni.getStorageSync('COMMUNITY_LIKED_POST_IDS') || [];
if (!Array.isArray(revertIds)) revertIds = [];
if (willLike) {
revertIds = revertIds.filter(id => id !== strId);
} else if (!revertIds.includes(strId)) {
revertIds.push(strId);
}
uni.setStorageSync('COMMUNITY_LIKED_POST_IDS', revertIds);
uni.setStorageSync('ACTIVE_COMMUNITY_POST', post.value);
uni.showToast({ title: (err && err.message) || '操作失败,请重试', icon: 'none' });
}
};
@@ -530,7 +543,11 @@ const handleJoinParty = () => {
applicantName,
applicantAvatar
});
} catch (_) {}
} catch (err) {
uni.hideLoading();
uni.showToast({ title: (err && err.message) || '申请失败,请重试', icon: 'none' });
return;
}
post.value.hasApplied = true;
post.value.myApplyStatus = 'PENDING';
@@ -624,10 +641,7 @@ const handleDeletePost = () => {
}, 500);
} catch (err) {
uni.hideLoading();
uni.showToast({ title: '动态已删除', icon: 'success' });
setTimeout(() => {
handleBack();
}, 500);
uni.showToast({ title: (err && err.message) || '删除失败,请重试', icon: 'none' });
}
}
}

查看文件

@@ -729,7 +729,19 @@ const toggleLike = async (post) => {
}
}
} catch (err) {
// 回滚乐观更新,避免"已点赞"却未落盘
console.warn('[Community] 点赞落盘异常:', err.message);
post.liked = !willLike;
post.likes += willLike ? -1 : 1;
let revertIds = uni.getStorageSync('COMMUNITY_LIKED_POST_IDS') || [];
if (!Array.isArray(revertIds)) revertIds = [];
if (willLike) {
revertIds = revertIds.filter(id => id !== strId);
} else if (!revertIds.includes(strId)) {
revertIds.push(strId);
}
uni.setStorageSync('COMMUNITY_LIKED_POST_IDS', revertIds);
uni.showToast({ title: (err && err.message) || '操作失败,请重试', icon: 'none' });
}
}
};
@@ -914,8 +926,7 @@ const handleDeletePost = (post) => {
uni.showToast({ title: '动态已删除', icon: 'success' });
} catch (err) {
uni.hideLoading();
posts.value = posts.value.filter(p => p.id !== post.id);
uni.showToast({ title: '动态已删除', icon: 'success' });
uni.showToast({ title: (err && err.message) || '删除失败,请重试', icon: 'none' });
}
}
}
@@ -1005,7 +1016,11 @@ const handleJoinParty = (post) => {
applicantName,
applicantAvatar
});
} catch (_) {}
} catch (err) {
uni.hideLoading();
uni.showToast({ title: (err && err.message) || '申请失败,请重试', icon: 'none' });
return;
}
post.hasApplied = true;
post.myApplyStatus = 'PENDING';