feat: 新增商户管理员账号自动创建功能,优化租户权限控制
1. 后端实现租户创建时自动绑定创建管理员账号,支持超管/普通管理员权限区分 2. 前端适配超管权限控制业务库名、连接串等敏感字段展示与编辑 3. 优化租户数据库回退逻辑,未配置独立库时自动回落默认库 4. 调整租户列表与详情页的权限数据脱敏逻辑
This commit is contained in:
@@ -95,7 +95,12 @@ func tenantLink(ctx context.Context, tenant *entity.ImTenant) (string, error) {
|
||||
return normalizeMySQLTimeOptions(tenant.DbDsn)
|
||||
}
|
||||
if tenant.DbName == "" {
|
||||
return "", gerror.New("租户业务库未配置")
|
||||
// 未配置独立业务库的商户回落共享默认库
|
||||
defaultLink := defaultDbLink(ctx)
|
||||
if defaultLink == "" {
|
||||
return "", gerror.New("默认数据库连接未配置,无法回落共享业务库")
|
||||
}
|
||||
return normalizeMySQLTimeOptions(defaultLink)
|
||||
}
|
||||
|
||||
defaultLink := defaultDbLink(ctx)
|
||||
|
||||
Reference in New Issue
Block a user