mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-27 01:41:28 +08:00
fix: 解决删除非面板 SSL 证书报错的问题 (#3218)
This commit is contained in:
parent
48ed9d8993
commit
011ef0818d
1 changed files with 2 additions and 5 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue