diff --git a/internal/data/mixrepoimpl/cmb.go b/internal/data/mixrepoimpl/cmb.go index ff1d0f4..fb57e48 100644 --- a/internal/data/mixrepoimpl/cmb.go +++ b/internal/data/mixrepoimpl/cmb.go @@ -119,6 +119,10 @@ func (s *CmbMixRepoImpl) GetRequest(_ context.Context, reqBo *bo.CmbRequestBo) ( func (s *CmbMixRepoImpl) GetMockRequest(_ context.Context, bizContent string) (*v1.CmbRequest, error) { + if len(s.bc.Cmb.CmbSm2Pik) == 0 { + return nil, errors.New("mock cmb sm2 pik is empty") + } + encryptBody, err := cmb.Encrypt(s.bc.Cmb.Sm2Puk, bizContent) if err != nil { return nil, err