Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持数据自定义加解密 #298

Open
Starsky-Synlitec opened this issue Aug 5, 2021 · 1 comment
Open

支持数据自定义加解密 #298

Starsky-Synlitec opened this issue Aug 5, 2021 · 1 comment

Comments

@Starsky-Synlitec
Copy link

具体说下
我们的业务涉及到传输的数据都是加密处理的。
现在我们前端会将数据加密后发给后端,后端解密后再去处理逻辑。传输的格式还是Json的,只是里面的字段是加密的。

所以不知道APIJSON有没有这样的中间层可以去处理这个情况。

为什么
希望可以定义数据加解密的部分,数据到APIJSON根据自定义逻辑去解密后再去处理数据库请求,返回数据也按照加解密逻辑去加密后返回。

@TommyLemon
Copy link
Collaborator

TommyLemon commented Aug 5, 2021

可以在 Controller 层统一处理,解密后再调 super 方法,然后把返回值加密
https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONDemo/src/main/java/apijson/demo/DemoController.java
image

如果不能统一处理(每个接口处理逻辑不一样),则编写远程函数来实现
#101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants