mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-18 17:31:55 +08:00
修复火山云证书上传获取空值的bug
This commit is contained in:
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…
x
Reference in New Issue
Block a user