From b3105417ec1268cd1fd674ad6f0f2d808edbc145 Mon Sep 17 00:00:00 2001 From: Mrx <18278715334@163.com> Date: Thu, 12 Feb 2026 16:56:17 +0800 Subject: [PATCH] f --- app/main/api/internal/types/types.go | 2 +- pkg/lzkit/crypto/ecb_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/main/api/internal/types/types.go b/app/main/api/internal/types/types.go index e673065..c91dd2a 100644 --- a/app/main/api/internal/types/types.go +++ b/app/main/api/internal/types/types.go @@ -1975,7 +1975,7 @@ type PaymentReq struct { Id string `json:"id"` PayMethod string `json:"pay_method"` // 支付方式: wechat, alipay, appleiap, test(仅开发环境), test_empty(仅开发环境-空报告模式) PayType string `json:"pay_type" validate:"required,oneof=query agent_vip agent_upgrade whitelist"` - Code string `json:"code"` // 微信小程序登录 code,用于未绑定 openid 时换取 openid 并调起支付(可选) + Code string `json:"code,optional"` // 微信小程序登录 code,未绑定 openid 时传此参数以换取 openid 并调起支付 } type PaymentResp struct { diff --git a/pkg/lzkit/crypto/ecb_test.go b/pkg/lzkit/crypto/ecb_test.go index fb8ed7e..4be8c87 100644 --- a/pkg/lzkit/crypto/ecb_test.go +++ b/pkg/lzkit/crypto/ecb_test.go @@ -78,7 +78,7 @@ func TestDecryptIDCard(t *testing.T) { // TestEncryptIDCard_DecryptIDCard 身份证加密解密 round-trip 测试 func TestEncryptIDCard_DecryptIDCard(t *testing.T) { - idCard := "360733199005090032" + idCard := "51018219920914121x" key, _ := hex.DecodeString("ff83609b2b24fc73196aac3d3dfb874f") // 加密 @@ -89,10 +89,11 @@ func TestEncryptIDCard_DecryptIDCard(t *testing.T) { } fmt.Printf("encrypted: %s\n", encrypted) // 解密 - decrypted, err := DecryptIDCard(encrypted, key) + decrypted, err := DecryptIDCard("Ix2KZkm22Uuw8FfgmWYzdRoo7lEtuTpiT8mwkQqNrdk=", key) if err != nil { t.Fatalf("身份证解密失败: %v", err) } + fmt.Printf("decrypted: %s\n", decrypted) if decrypted != idCard { t.Errorf("解密结果不匹配,期望: %s, 实际: %s", idCard, decrypted)