mirror of https://github.com/1Panel-dev/1Panel
fix: 解决自签证书填写 IP 不显示的问题 (#3200)
parent
b1e4ad9bfc
commit
a74ed6a317
|
@ -244,6 +244,21 @@ func (w WebsiteCAService) ObtainSSL(req request.WebsiteCAObtain) (*model.Website
|
||||||
websiteSSL.PrimaryDomain = domains[0]
|
websiteSSL.PrimaryDomain = domains[0]
|
||||||
websiteSSL.Domains = strings.Join(domains[1:], ",")
|
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, ",")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,8 @@ const initData = () => ({
|
||||||
keyType: 'P256',
|
keyType: 'P256',
|
||||||
domains: '',
|
domains: '',
|
||||||
id: 0,
|
id: 0,
|
||||||
time: 0,
|
time: 10,
|
||||||
unit: 'day',
|
unit: 'year',
|
||||||
pushDir: false,
|
pushDir: false,
|
||||||
dir: '',
|
dir: '',
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
|
|
Loading…
Reference in New Issue