优化修改网站域名时套餐相关检查

This commit is contained in:
刘祥超
2023-12-13 19:02:12 +08:00
parent 105479ce4b
commit 3b05b1a933
2 changed files with 14 additions and 3 deletions

View File

@@ -90,7 +90,7 @@ func (this *IndexAction) RunPost(params struct {
// 记录日志 // 记录日志
defer this.CreateLogInfo(codes.Server_ServerNamesLogUpdateServerNames, params.ServerId) defer this.CreateLogInfo(codes.Server_ServerNamesLogUpdateServerNames, params.ServerId)
serverNames := []*serverconfigs.ServerNameConfig{} var serverNames = []*serverconfigs.ServerNameConfig{}
err := json.Unmarshal([]byte(params.ServerNames), &serverNames) err := json.Unmarshal([]byte(params.ServerNames), &serverNames)
if err != nil { if err != nil {
this.Fail("域名解析失败:" + err.Error()) this.Fail("域名解析失败:" + err.Error())
@@ -105,10 +105,13 @@ func (this *IndexAction) RunPost(params struct {
this.NotFound("server", params.ServerId) this.NotFound("server", params.ServerId)
return return
} }
clusterId := serverResp.Server.NodeCluster.Id var clusterId = serverResp.Server.NodeCluster.Id
// 检查套餐
this.checkPlan(params.ServerId, serverNames)
// 检查域名是否已经存在 // 检查域名是否已经存在
allServerNames := serverconfigs.PlainServerNames(serverNames) var allServerNames = serverconfigs.PlainServerNames(serverNames)
if len(allServerNames) > 0 { if len(allServerNames) > 0 {
dupResp, err := this.RPC().ServerRPC().CheckServerNameDuplicationInNodeCluster(this.AdminContext(), &pb.CheckServerNameDuplicationInNodeClusterRequest{ dupResp, err := this.RPC().ServerRPC().CheckServerNameDuplicationInNodeCluster(this.AdminContext(), &pb.CheckServerNameDuplicationInNodeClusterRequest{
ServerNames: allServerNames, ServerNames: allServerNames,

View File

@@ -0,0 +1,8 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
//go:build !plus
package serverNames
func (this *IndexAction) checkPlan(serverId int64, serverNames []*serverconfigs.ServerNameConfig) {
// stub
}