V1.0.1 配置与规则纠偏:照片上限配置化+强校验 / 活体开关闭环 / 推荐阈值快照+规则版本化 / governance 三表+漂移审计
根治三类工程治理问题(技术默认值≠产品规则、配置存在但未闭环、文档代码漂移): - PROFILE-001:profile.photo.maxCount(默认6未确认)+ ProfilePolicy + 服务器端 FOR UPDATE 并发强校验(PHOTO_LIMIT_EXCEEDED,拒绝先于 S3 不留孤儿)+ 前端 mergeAppConfig 嵌套键修复 - CFG-001/IDENTITY-001:IdentityPolicy + GET /verification/liveness-status 真实判定点 (默认关不阻断,开则 enhancedVerified 变化,消除假开关)+ 删死 seed livenessVerification.enabled - MATCH-001:阈值60定为技术默认(消解 PENDING 矛盾)+ V050 recommendation_records.threshold_snapshot 规则版本化 + 删死重复配置类 MatchConfig - DOC-001:新增 docs/governance/(config-register/open-questions/decision-register/ hardcoded-rule-audit/config-drift-audit) - TEST-001:新增守卫 PhotoLimitGuardTest(8)/IdentityLivenessGuardTest(5)/ RecommendationThresholdSnapshotGuardTest(4),均经负向注入可红 全量回归 733/0/0/3(基线717+17新增-1删死测试);UI 契约门禁 18/18;STATUS 升 rc.21
This commit is contained in:
@@ -33,9 +33,25 @@ Page({
|
||||
|
||||
onLoad() {
|
||||
this._initSystemInfo();
|
||||
this._applyPhotoLimit();
|
||||
this.loadPhotos();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 服务端配置(appStore.businessConfig)可能在冷启动后才拉取完成,onShow 再取一次
|
||||
this._applyPhotoLimit();
|
||||
},
|
||||
|
||||
/**
|
||||
* 照片上限读运行时配置(服务端下发,经 appStore.businessConfig 覆盖本地默认),
|
||||
* 前端不写死 6(PROFILE-001)。生活照槽位 = 总上限 - 1(头像占 1 张)。
|
||||
*/
|
||||
_applyPhotoLimit() {
|
||||
const maxTotal = (appStore.state.businessConfig && appStore.state.businessConfig.MAX_PROFILE_PHOTOS)
|
||||
|| BUSINESS_LIMITS.MAX_PROFILE_PHOTOS;
|
||||
this.setData({ maxLifestyle: Math.max(0, maxTotal - 1) });
|
||||
},
|
||||
|
||||
_initSystemInfo() {
|
||||
try {
|
||||
const sysInfo = wx.getSystemInfoSync();
|
||||
@@ -70,7 +86,7 @@ Page({
|
||||
onAddLifestyle() {
|
||||
const remaining = this.data.maxLifestyle - this.data.lifestylePhotos.length;
|
||||
if (remaining <= 0) {
|
||||
appStore.toast(`最多上传 ${BUSINESS_LIMITS.MAX_PROFILE_PHOTOS} 张照片`);
|
||||
appStore.toast(`最多上传 ${this.data.maxLifestyle + 1} 张照片`);
|
||||
return;
|
||||
}
|
||||
this._chooseAndUpload('lifestyle');
|
||||
|
||||
Reference in New Issue
Block a user