You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
288 B
12 lines
288 B
2 years ago
|
const JSEncrypt = require('../libs/jsencrypt/lib/index').default;
|
||
|
|
||
|
export function encryptedData(key, data) {
|
||
|
// 新建JSEncrypt对象
|
||
|
let encryptor = new JSEncrypt();
|
||
|
// 设置公钥
|
||
|
encryptor.setPublicKey(key);
|
||
|
// 加密数据
|
||
|
return encryptor.encrypt(data);
|
||
|
}
|
||
|
|