Parcourir la source

add
创建长期记忆体

lifang il y a 3 mois
Parent
commit
f8d9a26a54

+ 3 - 4
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/controller/BizWxAppletClinicController.java

@@ -88,15 +88,14 @@ public class BizWxAppletClinicController extends BaseController{
     }
 
     @PostMapping("/touchMemoryId")
-    @ApiOperation(value = "查询手术咨询的memoryId、AppId和ApiKey",notes = "根据AES算法进行解密,秘钥为clinicId", position = 9)
+    @ApiOperation(value = "查询手术咨询的memoryId、AppId和ApiKey",notes = "根据AES算法进行解密,秘钥为clinicId前16位,如果不够,后续补0到16位", position = 9)
     public CommonResult<String> createSessionId(@RequestBody@Validated BizCreateAgentSessionDTO source) throws IOException {
         BizAiAgentParamVO paramVO= clinicRoomService.touchMemoryId(source);
         // 使用AES对paramVO的JSON进行加密,秘钥为clinicId
         String jsonParamVO = JsonUtils.toJsonString(paramVO);
         String key = StrUtil.padAfter(source.getClinicId(), 16, '0');
 
-        AES aes = SecureUtil.aes(key.getBytes());
-        String encryptedData = aes.encryptHex(jsonParamVO);
-        return CommonResult.success(encryptedData);
+        AES aes = new AES(key.getBytes());
+        return CommonResult.success(aes.encryptHex(jsonParamVO));
     }
 }