带阿里标识的版本
This commit is contained in:
@@ -102,6 +102,8 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
NsIsOn bool
|
||||
|
||||
HttpdnsIsOn bool
|
||||
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
@@ -112,6 +114,15 @@ func (this *IndexAction) RunPost(params struct {
|
||||
Gt(0, "请选择一个集群")
|
||||
|
||||
var config = userconfigs.DefaultUserRegisterConfig()
|
||||
{
|
||||
// 先读取现有配置,避免保存时把未出现在当前表单里的字段重置为默认值
|
||||
resp, err := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{
|
||||
Code: systemconfigs.SettingCodeUserRegisterConfig,
|
||||
})
|
||||
if err == nil && len(resp.ValueJSON) > 0 {
|
||||
_ = json.Unmarshal(resp.ValueJSON, config)
|
||||
}
|
||||
}
|
||||
config.IsOn = params.IsOn
|
||||
config.ComplexPassword = params.ComplexPassword
|
||||
config.RequireVerification = params.RequireVerification
|
||||
@@ -142,6 +153,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
config.ADIsOn = params.AdIsOn
|
||||
|
||||
config.NSIsOn = params.NsIsOn
|
||||
config.HTTPDNSIsOn = params.HttpdnsIsOn
|
||||
|
||||
configJSON, err := json.Marshal(config)
|
||||
if err != nil {
|
||||
@@ -157,10 +169,15 @@ func (this *IndexAction) RunPost(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
if params.FeatureOp != "keep" {
|
||||
featureOp := params.FeatureOp
|
||||
if featureOp != "overwrite" && featureOp != "append" && featureOp != "keep" {
|
||||
featureOp = "keep"
|
||||
}
|
||||
|
||||
if featureOp != "keep" {
|
||||
_, err = this.RPC().UserRPC().UpdateAllUsersFeatures(this.AdminContext(), &pb.UpdateAllUsersFeaturesRequest{
|
||||
FeatureCodes: params.Features,
|
||||
Overwrite: params.FeatureOp == "overwrite",
|
||||
Overwrite: featureOp == "overwrite",
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
Reference in New Issue
Block a user