|
@@ -36,14 +36,23 @@ DPSg6QKBgAR7IMz5wCkdS//PbIS8UOmxXHwwkZgrtAf56+xyvyQiOdcZj/xFolY4
|
|
|
X86xznY0cuDr9o5sWdNXDqcZFOGS4txwCOEyI3VntYReO005nS6vsfDiGqyutlZh
|
|
X86xznY0cuDr9o5sWdNXDqcZFOGS4txwCOEyI3VntYReO005nS6vsfDiGqyutlZh
|
|
|
9gAMVA6Hm3UFKvxrjgmpMOAMYqugRx5hFxhjiiaDRScoewx5abHN`;
|
|
9gAMVA6Hm3UFKvxrjgmpMOAMYqugRx5hFxhjiiaDRScoewx5abHN`;
|
|
|
|
|
|
|
|
-// 加密
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * @description: 加密
|
|
|
|
|
+ * @param {string} txt 待加密字符串
|
|
|
|
|
+ * @return {string} 加密后的字符串
|
|
|
|
|
+ * */
|
|
|
|
|
+
|
|
|
export function encrypt(txt) {
|
|
export function encrypt(txt) {
|
|
|
const encryptor = new JSEncrypt();
|
|
const encryptor = new JSEncrypt();
|
|
|
encryptor.setPublicKey(publicKey); // 设置公钥
|
|
encryptor.setPublicKey(publicKey); // 设置公钥
|
|
|
return encryptor.encrypt(txt); // 对数据进行加密
|
|
return encryptor.encrypt(txt); // 对数据进行加密
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 解密
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * @description: 解密
|
|
|
|
|
+ * @param {string} txt 待解密字符串
|
|
|
|
|
+ * @return {string} 解密字符串
|
|
|
|
|
+ * */
|
|
|
export function decrypt(txt) {
|
|
export function decrypt(txt) {
|
|
|
const encryptor = new JSEncrypt();
|
|
const encryptor = new JSEncrypt();
|
|
|
encryptor.setPrivateKey(privateKey); // 设置私钥
|
|
encryptor.setPrivateKey(privateKey); // 设置私钥
|