From 5dfd3c39c3eb07dd1d151c5c94b6ac25315b9166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Mon, 10 Mar 2025 09:55:30 +0800 Subject: [PATCH] cmb --- internal/data/mixrepoimpl/cmb.go | 4 ++++ 1 file changed, 4 insertions(+) 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