1
0
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:
zhengkunwang 2023-12-07 16:22:06 +08:00 committed by GitHub
parent 48ed9d8993
commit 011ef0818d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,11 +351,8 @@ func (w WebsiteSSLService) Delete(ids []uint) error {
if sslSetting.Value == "enable" {
sslID, _ := settingRepo.Get(settingRepo.WithByKey("SSLID"))
idValue, _ := strconv.Atoi(sslID.Value)
if idValue > 0 {
oldSSL, _ := websiteSSLRepo.GetFirst(commonRepo.WithByID(uint(idValue)))
if oldSSL.ID > 0 {
return buserr.New("ErrDeleteWithPanelSSL")
}
if idValue > 0 && uint(idValue) == id {
return buserr.New("ErrDeleteWithPanelSSL")
}
}
_ = websiteSSLRepo.DeleteBy(commonRepo.WithByID(id))