Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 429 Bytes

README.md

File metadata and controls

18 lines (15 loc) · 429 Bytes

Spring Boot Encrypt Decode

简介

Spring Boot 2.0+ JSON字符串加密解密

RequestBodyAdvice / ResponseBodyAdvice

  • RequestBodyAdvice 请求拦截并加密

  • ResponseBodyAdvice 响应拦截并加密

  • 请求必须是@RequestBody、请求的Content-Type=application/x-www-form-urlencoded

public String index(@RequestBody String body){
    logger.info("请求信息: " + body);
    return body;
}