Files
2024-09-27 01:16:36 +08:00

10 lines
458 B
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## RSA 非对称加密
私钥 公钥
1前端传递参数给后端的时候先将数据 object 转换为 "key=value&key=value" 然后通过私钥对数据进行加密放到请求头中token传递给后端
2后端拿到请求头通过公钥解密重新排列数据为 object 然后查询计算完成拿到数据后端再用公钥加密json数据然后返回给前端
3前端通过私钥解密后端的json渲染页面