zmdms-utils 0.0.90 → 0.0.91
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/dist/es/common.js +7 -1
- package/package.json +1 -1
- package/src/common.ts +9 -2
package/dist/es/common.js
CHANGED
|
@@ -75,7 +75,13 @@ function parseQueryParams(url) {
|
|
|
75
75
|
if (queryString) {
|
|
76
76
|
var searchList = queryString.split("&");
|
|
77
77
|
for (var i = 0; i < searchList.length; i++) {
|
|
78
|
-
|
|
78
|
+
// const [key, value] = searchList[i].split("=");
|
|
79
|
+
// 支持参数?params=xxxxx==&key=value 这种模式的
|
|
80
|
+
var splitIndex = searchList[i].indexOf("=");
|
|
81
|
+
var _a = [
|
|
82
|
+
searchList[i].substring(0, splitIndex),
|
|
83
|
+
searchList[i].substring(splitIndex + 1),
|
|
84
|
+
], key = _a[0], value = _a[1];
|
|
79
85
|
var val = decodeURIComponent(value);
|
|
80
86
|
if (val.startsWith("{")) {
|
|
81
87
|
try {
|
package/package.json
CHANGED
package/src/common.ts
CHANGED
|
@@ -25,7 +25,7 @@ export const emitter = mitt();
|
|
|
25
25
|
export function addThousedSeparator(
|
|
26
26
|
n: any,
|
|
27
27
|
digit: number = 3,
|
|
28
|
-
symbol: string = ","
|
|
28
|
+
symbol: string = ",",
|
|
29
29
|
) {
|
|
30
30
|
if (n != null) {
|
|
31
31
|
let _n = n.toString();
|
|
@@ -80,7 +80,14 @@ export function parseQueryParams(url: string): { [key: string]: string } {
|
|
|
80
80
|
if (queryString) {
|
|
81
81
|
const searchList = queryString.split("&");
|
|
82
82
|
for (let i = 0; i < searchList.length; i++) {
|
|
83
|
-
const [key, value] = searchList[i].split("=");
|
|
83
|
+
// const [key, value] = searchList[i].split("=");
|
|
84
|
+
// 支持参数?params=xxxxx==&key=value 这种模式的
|
|
85
|
+
const splitIndex = searchList[i].indexOf("=");
|
|
86
|
+
const [key, value] = [
|
|
87
|
+
searchList[i].substring(0, splitIndex),
|
|
88
|
+
searchList[i].substring(splitIndex + 1),
|
|
89
|
+
];
|
|
90
|
+
|
|
84
91
|
let val: any = decodeURIComponent(value);
|
|
85
92
|
if (val.startsWith("{")) {
|
|
86
93
|
try {
|