mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-26 04:06:34 +08:00
优化代码
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package https
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
@@ -43,7 +44,7 @@ func (this *IndexAction) RunGet(params struct {
|
||||
httpsConfig.IsOn = true
|
||||
}
|
||||
|
||||
_ = httpsConfig.Init(nil)
|
||||
_ = httpsConfig.Init(context.TODO())
|
||||
var httpsPorts = httpsConfig.AllPorts()
|
||||
|
||||
// 检查http和https端口冲突
|
||||
|
||||
@@ -32,18 +32,18 @@ func (this *RequestCertPopupAction) RunGet(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
serverNameConfigs := []*serverconfigs.ServerNameConfig{}
|
||||
var serverNameConfigs = []*serverconfigs.ServerNameConfig{}
|
||||
err = json.Unmarshal(serverNamesResp.ServerNamesJSON, &serverNameConfigs)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
excludeServerNames := []string{}
|
||||
var excludeServerNames = []string{}
|
||||
if len(params.ExcludeServerNames) > 0 {
|
||||
excludeServerNames = strings.Split(params.ExcludeServerNames, ",")
|
||||
}
|
||||
serverNames := []string{}
|
||||
var serverNames = []string{}
|
||||
for _, c := range serverNameConfigs {
|
||||
if len(c.SubNames) == 0 {
|
||||
if domainutils.ValidateDomainFormat(c.Name) && !lists.ContainsString(excludeServerNames, c.Name) {
|
||||
@@ -64,7 +64,12 @@ func (this *RequestCertPopupAction) RunGet(params struct {
|
||||
AdminId: this.AdminId(),
|
||||
UserId: 0,
|
||||
})
|
||||
userMaps := []maps.Map{}
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
var userMaps = []maps.Map{}
|
||||
for _, user := range acmeUsersResp.AcmeUsers {
|
||||
description := user.Description
|
||||
if len(description) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user