fix: 解决自签证书填写 IP 不显示的问题 (#3200)

This commit is contained in:
zhengkunwang 2023-12-06 17:00:11 +08:00 committed by GitHub
parent b1e4ad9bfc
commit a74ed6a317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -244,6 +244,21 @@ func (w WebsiteCAService) ObtainSSL(req request.WebsiteCAObtain) (*model.Website
websiteSSL.PrimaryDomain = domains[0]
websiteSSL.Domains = strings.Join(domains[1:], ",")
}
ipStrings := make([]string, len(ips))
for i, ip := range ips {
ipStrings[i] = ip.String()
}
if websiteSSL.PrimaryDomain == "" && len(ips) > 0 {
websiteSSL.PrimaryDomain = ipStrings[0]
ipStrings = ipStrings[1:]
}
if len(ipStrings) > 0 {
if websiteSSL.Domains != "" {
websiteSSL.Domains += ","
}
websiteSSL.Domains += strings.Join(ipStrings, ",")
}
}
}

View File

@ -95,8 +95,8 @@ const initData = () => ({
keyType: 'P256',
domains: '',
id: 0,
time: 0,
unit: 'day',
time: 10,
unit: 'year',
pushDir: false,
dir: '',
autoRenew: true,