perf(encrypt):加解密调整
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
package com.tiesheng.encrypt;
|
||||
|
||||
|
||||
import com.tiesheng.encrypt.config.DecryptRequestBodyAdvice;
|
||||
import com.tiesheng.encrypt.config.EncryptResponseBodyAdvice;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
@Documented
|
||||
@Import({
|
||||
DecryptRequestBodyAdvice.class,
|
||||
EncryptResponseBodyAdvice.class,
|
||||
})
|
||||
public @interface EnableEncryptConfig {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.tiesheng.encrypt;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@ComponentScan({
|
||||
"com.tiesheng.encrypt.**.*",
|
||||
})
|
||||
public class EncryptAutoConfigurer {
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice<ApiResp> {
|
||||
try {
|
||||
|
||||
Object data = body.getData();
|
||||
if (data == null || !body.successful()) {
|
||||
if (data == null || !body.successful() || !encryptConfig.isBody()) {
|
||||
return body;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user