mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 12:20:28 +08:00
优化修改网站域名时套餐相关检查
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user