diff --git a/monkey-api-encrypt-core/src/main/java/com/cxytiandi/encrypt/core/EncryptionFilter.java b/monkey-api-encrypt-core/src/main/java/com/cxytiandi/encrypt/core/EncryptionFilter.java index dbd95d5..f400195 100644 --- a/monkey-api-encrypt-core/src/main/java/com/cxytiandi/encrypt/core/EncryptionFilter.java +++ b/monkey-api-encrypt-core/src/main/java/com/cxytiandi/encrypt/core/EncryptionFilter.java @@ -73,6 +73,8 @@ public EncryptionFilter(String key, List responseEncryptUriList, List list, String uri, String methodType, HttpS // 优先用AntPathMatcher,其实用这个也够了,底层是一样的,下面用的方式兜底 for (String u : list) { - boolean match = new AntPathMatcher().match(u, uri); + boolean match = antPathMatcher.match(u, prefixUri); if (match) { return true; } diff --git a/monkey-api-encrypt-springboot-example/src/main/java/com/cxytiandi/encrypt_springboot_example/controller/UserController.java b/monkey-api-encrypt-springboot-example/src/main/java/com/cxytiandi/encrypt_springboot_example/controller/UserController.java index 010018b..9530522 100644 --- a/monkey-api-encrypt-springboot-example/src/main/java/com/cxytiandi/encrypt_springboot_example/controller/UserController.java +++ b/monkey-api-encrypt-springboot-example/src/main/java/com/cxytiandi/encrypt_springboot_example/controller/UserController.java @@ -65,6 +65,16 @@ public UserDto save(@RequestBody UserDto dto, @PathVariable int id) { System.err.println(dto.getId() + "\t" + dto.getName()); return dto; } + + @Encrypt + @GetMapping("/save/{id}") + public UserDto getUser(@PathVariable int id) { + UserDto dto = new UserDto(); + dto.setId(id); + dto.setName("加密实体对象"); + return dto; + } + @RequestMapping(value="encryptEntityXml",produces= {MediaType.APPLICATION_XML_VALUE}) public UserXmlDto encryptEntityXml() {