tools-min-ns 1.9.7 → 1.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,10 @@ cnpm i tools-min-ns --save
5
5
  ```
6
6
 
7
7
  # updates
8
+ ## v1.9.8
9
+
10
+ > PasswordUtil aes加解密使用URL编码和解码
11
+
8
12
  ## v1.9.7
9
13
 
10
14
  > DateUtil 月份错误bug修复
@@ -25,6 +29,7 @@ cnpm i tools-min-ns --save
25
29
  ## v1.9.3
26
30
 
27
31
  > DateUtil 优化并新增isDateInYearAndMonth方法
32
+ >
28
33
  > UrlUtil 优化getUrlRequest在web,h5中的路由为hash的兼容性
29
34
 
30
35
  ## v1.9.2
@@ -58,8 +63,11 @@ cnpm i tools-min-ns --save
58
63
  ## v1.7.0
59
64
 
60
65
  > 新增FileUtil
66
+ >
61
67
  > ObjectUtil 新增getHash
68
+ >
62
69
  > StringUtil 新增getHash
70
+ >
63
71
  > BrowserUtil 新增getIdSync
64
72
 
65
73
  ## v1.6.0
@@ -83,7 +91,9 @@ getDateDiff 修复
83
91
  2. 优化浏览器判断
84
92
 
85
93
  > 新增CookieUtil cookie增删改查
94
+ >
86
95
  > 新增EnvUtil 环境判断
96
+ >
87
97
  > 新增RequestUtil 请求工具
88
98
 
89
99
  ## v1.4.0
@@ -12,7 +12,7 @@ declare namespace PasswordUtil {
12
12
  * @example
13
13
  * strEncrypt('XX') => 3f231e9c5040a51a663a4e12ddd509fc31f201caf95f
14
14
  */
15
- const strEncrypt: (str: string, pwd?: string) => any;
15
+ const strEncrypt: (str: string, pwd?: string) => string;
16
16
  /**
17
17
  * AES解密函数
18
18
  * @param str 待解密字符串
@@ -29,7 +29,7 @@ var PasswordUtil;
29
29
  mode: CryptoJS.mode.ECB,
30
30
  padding: CryptoJS.pad.Pkcs7
31
31
  });
32
- return encrypted.toString();
32
+ return encodeURIComponent(encrypted.toString());
33
33
  };
34
34
  /**
35
35
  * AES解密函数
@@ -44,7 +44,7 @@ var PasswordUtil;
44
44
  }
45
45
  if (str == '') return '';
46
46
  var key = CryptoJS.enc.Utf8.parse(pwd);
47
- var decrypt = CryptoJS.AES.decrypt(str, key, {
47
+ var decrypt = CryptoJS.AES.decrypt(decodeURIComponent(str), key, {
48
48
  mode: CryptoJS.mode.ECB,
49
49
  padding: CryptoJS.pad.Pkcs7
50
50
  });
@@ -12,7 +12,7 @@ declare namespace PasswordUtil {
12
12
  * @example
13
13
  * strEncrypt('XX') => 3f231e9c5040a51a663a4e12ddd509fc31f201caf95f
14
14
  */
15
- const strEncrypt: (str: string, pwd?: string) => any;
15
+ const strEncrypt: (str: string, pwd?: string) => string;
16
16
  /**
17
17
  * AES解密函数
18
18
  * @param str 待解密字符串
@@ -39,7 +39,7 @@ var PasswordUtil;
39
39
  mode: CryptoJS.mode.ECB,
40
40
  padding: CryptoJS.pad.Pkcs7
41
41
  });
42
- return encrypted.toString();
42
+ return encodeURIComponent(encrypted.toString());
43
43
  };
44
44
  /**
45
45
  * AES解密函数
@@ -54,7 +54,7 @@ var PasswordUtil;
54
54
  }
55
55
  if (str == '') return '';
56
56
  var key = CryptoJS.enc.Utf8.parse(pwd);
57
- var decrypt = CryptoJS.AES.decrypt(str, key, {
57
+ var decrypt = CryptoJS.AES.decrypt(decodeURIComponent(str), key, {
58
58
  mode: CryptoJS.mode.ECB,
59
59
  padding: CryptoJS.pad.Pkcs7
60
60
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tools-min-ns",
3
3
  "description": "工具包适用于前端以及node",
4
- "version": "1.9.7",
4
+ "version": "1.9.8",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",
7
7
  "author": "nanshen",