mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
fix: 解决删除非面板 SSL 证书报错的问题 (#3218)
This commit is contained in:
parent
48ed9d8993
commit
011ef0818d
@ -351,11 +351,8 @@ func (w WebsiteSSLService) Delete(ids []uint) error {
|
|||||||
if sslSetting.Value == "enable" {
|
if sslSetting.Value == "enable" {
|
||||||
sslID, _ := settingRepo.Get(settingRepo.WithByKey("SSLID"))
|
sslID, _ := settingRepo.Get(settingRepo.WithByKey("SSLID"))
|
||||||
idValue, _ := strconv.Atoi(sslID.Value)
|
idValue, _ := strconv.Atoi(sslID.Value)
|
||||||
if idValue > 0 {
|
if idValue > 0 && uint(idValue) == id {
|
||||||
oldSSL, _ := websiteSSLRepo.GetFirst(commonRepo.WithByID(uint(idValue)))
|
return buserr.New("ErrDeleteWithPanelSSL")
|
||||||
if oldSSL.ID > 0 {
|
|
||||||
return buserr.New("ErrDeleteWithPanelSSL")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ = websiteSSLRepo.DeleteBy(commonRepo.WithByID(id))
|
_ = websiteSSLRepo.DeleteBy(commonRepo.WithByID(id))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user