update 前端加入RSA非对称加密,后端暂时关闭加密
This commit is contained in:
13
Web/src/util/rsa/index.js
Normal file
13
Web/src/util/rsa/index.js
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user