mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 19:57:42 +08:00
fix bugs issue/609
This commit is contained in:
parent
ac6e5fcb8c
commit
d6787d9092
@ -652,6 +652,21 @@ func (g *GatewayAction) UpdCertificate(req *apimodel.UpdCertificateReq) error {
|
||||
return fmt.Errorf(msg, err)
|
||||
}
|
||||
|
||||
if cert == nil {
|
||||
// cert do not exists in region db, create it
|
||||
cert = &model.Certificate{
|
||||
UUID: req.CertificateID,
|
||||
CertificateName: req.CertificateName,
|
||||
Certificate: req.Certificate,
|
||||
PrivateKey: req.PrivateKey,
|
||||
}
|
||||
if err := db.GetManager().CertificateDao().AddModel(cert); err != nil {
|
||||
msg := "update cert error :%s"
|
||||
return fmt.Errorf(msg, err.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
cert.CertificateName = req.CertificateName
|
||||
cert.Certificate = req.Certificate
|
||||
cert.PrivateKey = req.PrivateKey
|
||||
|
Loading…
Reference in New Issue
Block a user