fix: keep only tenant realname review policy

This commit is contained in:
richjohnrambo
2026-09-23 02:08:13 +08:00
parent 62856194e5
commit 1ec2feee47
7 changed files with 8 additions and 45 deletions
+1 -5
View File
@@ -28,8 +28,7 @@ func (a *adapter) RealNamePolicy(tenantID t.TenantID) (*t.RealNamePolicy, error)
var policy t.RealNamePolicy
// 商户配置已并入 im_tenant(manager 仓库 im_tenant_merge_config.sql),实名政策兜底直查切到 im_tenant;
// id AS tenant_id 保持扫描列名不变,ErrNoRows/未知列仍回退默认值,兼容阶段一迁移未执行的滚动发布窗口
err := db.GetContext(ctx, &policy, `SELECT id AS tenant_id, realname_review_policy, realname_provider_mode,
realname_required, realname_allow_skip, realname_remind_after
err := db.GetContext(ctx, &policy, `SELECT id AS tenant_id, realname_review_policy
FROM im_tenant WHERE id=? LIMIT 1`, tenantID)
if errors.Is(err, sql.ErrNoRows) {
policy = *defaultRealNamePolicy(tenantID)
@@ -50,9 +49,6 @@ func defaultRealNamePolicy(tenantID t.TenantID) *t.RealNamePolicy {
policy := &t.RealNamePolicy{
TenantID: tenantID,
ReviewPolicy: t.RealNameReviewPolicyNone,
ProviderMode: "id_card_2factor",
AllowSkip: true,
RemindAfter: "24h",
}
policy.Normalize()
return policy