From 5233f0f0f0723b6d4c1b3861627aba4bb19b154e Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Sun, 9 Nov 2025 16:08:05 +0800 Subject: [PATCH] fix DecryptParams --- internal/application/api/api_application_service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/application/api/api_application_service.go b/internal/application/api/api_application_service.go index 5f5b36e..5c9c338 100644 --- a/internal/application/api/api_application_service.go +++ b/internal/application/api/api_application_service.go @@ -54,7 +54,7 @@ type ApiApplicationService interface { EncryptParams(ctx context.Context, userID string, cmd *commands.EncryptCommand) (string, error) // 解密参数接口 - DecryptParams(ctx context.Context, userID string, cmd *commands.DecryptCommand) (map[string]interface{}, error) + DecryptParams(ctx context.Context, userID string, cmd *commands.DecryptCommand) (interface{}, error) // 获取表单配置 GetFormConfig(ctx context.Context, apiCode string) (*dto.FormConfigResponse, error) @@ -890,7 +890,7 @@ func (s *ApiApplicationServiceImpl) EncryptParams(ctx context.Context, userID st } // DecryptParams 解密参数 -func (s *ApiApplicationServiceImpl) DecryptParams(ctx context.Context, userID string, cmd *commands.DecryptCommand) (map[string]interface{}, error) { +func (s *ApiApplicationServiceImpl) DecryptParams(ctx context.Context, userID string, cmd *commands.DecryptCommand) (interface{}, error) { // 1. 使用前端传来的SecretKey进行解密 decryptedData, err := crypto.AesDecrypt(cmd.EncryptedData, cmd.SecretKey) if err != nil { @@ -898,8 +898,8 @@ func (s *ApiApplicationServiceImpl) DecryptParams(ctx context.Context, userID st return nil, err } - // 2. 将解密后的JSON字节数组转换为map - var result map[string]interface{} + // 2. 将解密后的JSON字节数组转换为通用结构 + var result interface{} err = json.Unmarshal(decryptedData, &result) if err != nil { s.logger.Error("反序列化解密数据失败", zap.Error(err))