mirror of https://github.com/usual2970/certimate
修复火山云证书上传获取空值的bug
parent
88b90986b1
commit
5fe24465d7
|
@ -72,12 +72,17 @@ func (u *UploaderProvider) Upload(ctx context.Context, certPem string, privkeyPe
|
|||
}
|
||||
|
||||
var certId string
|
||||
if importCertificateResp.InstanceId != nil {
|
||||
if importCertificateResp.InstanceId != nil && *importCertificateResp.InstanceId != "" {
|
||||
certId = *importCertificateResp.InstanceId
|
||||
}
|
||||
if importCertificateResp.RepeatId != nil {
|
||||
if importCertificateResp.RepeatId != nil && *importCertificateResp.RepeatId != "" {
|
||||
certId = *importCertificateResp.RepeatId
|
||||
}
|
||||
|
||||
if certId == "" {
|
||||
return nil, xerrors.New("failed to get certId from importCertificateResp, both InstanceId and RepeatId are empty")
|
||||
}
|
||||
|
||||
return &uploader.UploadResult{
|
||||
CertId: certId,
|
||||
}, nil
|
||||
|
|
Loading…
Reference in New Issue