Skip to content

Commit 3b05b1a

Browse files
committed
优化修改网站域名时套餐相关检查
1 parent 105479c commit 3b05b1a

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

internal/web/actions/default/servers/server/settings/serverNames/index.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (this *IndexAction) RunPost(params struct {
9090
// 记录日志
9191
defer this.CreateLogInfo(codes.Server_ServerNamesLogUpdateServerNames, params.ServerId)
9292

93-
serverNames := []*serverconfigs.ServerNameConfig{}
93+
var serverNames = []*serverconfigs.ServerNameConfig{}
9494
err := json.Unmarshal([]byte(params.ServerNames), &serverNames)
9595
if err != nil {
9696
this.Fail("域名解析失败:" + err.Error())
@@ -105,10 +105,13 @@ func (this *IndexAction) RunPost(params struct {
105105
this.NotFound("server", params.ServerId)
106106
return
107107
}
108-
clusterId := serverResp.Server.NodeCluster.Id
108+
var clusterId = serverResp.Server.NodeCluster.Id
109+
110+
// 检查套餐
111+
this.checkPlan(params.ServerId, serverNames)
109112

110113
// 检查域名是否已经存在
111-
allServerNames := serverconfigs.PlainServerNames(serverNames)
114+
var allServerNames = serverconfigs.PlainServerNames(serverNames)
112115
if len(allServerNames) > 0 {
113116
dupResp, err := this.RPC().ServerRPC().CheckServerNameDuplicationInNodeCluster(this.AdminContext(), &pb.CheckServerNameDuplicationInNodeClusterRequest{
114117
ServerNames: allServerNames,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright 2023 GoEdge CDN [email protected]. All rights reserved. Official site: https://goedge.cn .
2+
//go:build !plus
3+
4+
package serverNames
5+
6+
func (this *IndexAction) checkPlan(serverId int64, serverNames []*serverconfigs.ServerNameConfig) {
7+
// stub
8+
}

0 commit comments

Comments
 (0)