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
-4
View File
@@ -562,10 +562,6 @@ func createTenantRegistry(tx *sql.Tx, registryDB, _ string) error {
max_groups BIGINT UNSIGNED NOT NULL DEFAULT 0,
max_group_members INT UNSIGNED NOT NULL DEFAULT 0,
realname_review_policy TINYINT(1) NOT NULL DEFAULT 0,
realname_provider_mode VARCHAR(32) NOT NULL DEFAULT 'id_card_2factor',
realname_required TINYINT(1) NOT NULL DEFAULT 0,
realname_allow_skip TINYINT(1) NOT NULL DEFAULT 1,
realname_remind_after VARCHAR(32) NOT NULL DEFAULT '24h',
aliyun_moderation_enabled TINYINT(1) NOT NULL DEFAULT 0,
local_moderation_enabled TINYINT(1) NOT NULL DEFAULT 0,
message_encryption_enabled TINYINT(1) NOT NULL DEFAULT 0,
+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