update 前端加入RSA非对称加密,后端暂时关闭加密

This commit is contained in:
2021-05-13 00:07:42 +08:00
parent 88fa93f87e
commit 1eea4dfa85
5 changed files with 21 additions and 1 deletions

13
Web/src/util/rsa/index.js Normal file
View File

@@ -0,0 +1,13 @@
import { JSEncrypt } from 'jsencrypt'
/**
* RSA加解密
*/
const encryptByRSA = (message, publicKey) => {
const Encrypt = new JSEncrypt()
Encrypt.setPublicKey(publicKey)
return Encrypt.encrypt(message)
}
export {
encryptByRSA
}