|
|
@@ -7,6 +7,24 @@ export default class crypto {
|
|
|
// 使用DesUtil.genDesKey()生成,需和后端配置保持一致
|
|
|
static desKey = "jMVCBsFGDQr1USHo";
|
|
|
|
|
|
+ /**
|
|
|
+ * aes 加密方法
|
|
|
+ * @param data
|
|
|
+ * @returns {*}
|
|
|
+ */
|
|
|
+ static encrypt(data) {
|
|
|
+ return this.encryptAES(data, this.aesKey);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * aes 解密方法
|
|
|
+ * @param data
|
|
|
+ * @returns {*}
|
|
|
+ */
|
|
|
+ static decrypt(data) {
|
|
|
+ return this.decryptAES(data, this.aesKey);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* aes 加密方法,同java:AesUtil.encryptToBase64(text, aesKey);
|
|
|
*/
|