@das-fed/utils 6.3.0-beta.10 → 6.3.0-beta.11
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/common-info/set-personal-info/index.js +591 -565
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-tools/date-format/index.js +2 -1
- package/common-tools/get-url-params/index.d.ts +1 -1
- package/common-tools/get-url-params/index.js +49 -46
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/create-api-service/index.js +1405 -1371
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/index.js +739 -714
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/index.js +856 -830
- package/curring-http/index.js.gz +0 -0
- package/package.json +5 -3
- package/pinyin-first-character/index.js +142 -132
- package/pinyin-first-character/index.js.gz +0 -0
- package/style/index.js +1 -1
- package/style/index.js.gz +0 -0
|
Binary file
|
|
@@ -10,7 +10,8 @@ const a = (s, t = "yyyy-MM-dd HH:mm:ss") => {
|
|
|
10
10
|
S: e.getMilliseconds()
|
|
11
11
|
}, g = e.getFullYear().toString();
|
|
12
12
|
g = g.length >= 4 ? g : "0000".substr(0, 4 - g.length) + g, /(y+)/.test(t) && (t = t.replace(RegExp.$1, (g + "").substr(4 - RegExp.$1.length)));
|
|
13
|
-
for (var n in r)
|
|
13
|
+
for (var n in r)
|
|
14
|
+
new RegExp("(" + n + ")").test(t) && (t = t.replace(RegExp.$1, RegExp.$1.length === 1 ? r[n] : ("00" + r[n]).substr(("" + r[n]).length)));
|
|
14
15
|
return t;
|
|
15
16
|
};
|
|
16
17
|
export {
|
|
@@ -37,7 +37,7 @@ export declare const objectToUrlparams: (params: any) => string;
|
|
|
37
37
|
* @param pathParams 参数,数组格式
|
|
38
38
|
* @returns
|
|
39
39
|
*/
|
|
40
|
-
export declare const addPathParamsToUrl: (url: string, pathParams:
|
|
40
|
+
export declare const addPathParamsToUrl: (url: string, pathParams: string[]) => any;
|
|
41
41
|
/**
|
|
42
42
|
* 从URL中获取origin
|
|
43
43
|
* @param url url
|
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = (n, s) => {
|
|
2
2
|
let e = window.location.search || "";
|
|
3
|
-
if (
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
if (n && n !== location.href) {
|
|
4
|
+
const t = n.indexOf("?");
|
|
5
|
+
t !== -1 ? e = n.slice(t) : e = "";
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
7
|
+
const r = new URLSearchParams(e);
|
|
8
|
+
if (s)
|
|
9
|
+
return r.get(s);
|
|
10
10
|
{
|
|
11
|
-
let
|
|
12
|
-
for (let [
|
|
13
|
-
|
|
14
|
-
return
|
|
11
|
+
let t = {};
|
|
12
|
+
for (let [o, l] of r.entries())
|
|
13
|
+
t[o] = l;
|
|
14
|
+
return t;
|
|
15
15
|
}
|
|
16
|
-
}, f = (
|
|
17
|
-
let e = "",
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
}),
|
|
22
|
-
}, h = (
|
|
23
|
-
const e =
|
|
24
|
-
if (!
|
|
25
|
-
let
|
|
26
|
-
if (!
|
|
27
|
-
let
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
}), e.includes("?") ? e.split("?")[0] + `?${
|
|
31
|
-
}, u = (
|
|
32
|
-
const
|
|
33
|
-
for (const [
|
|
34
|
-
e.hasOwnProperty(
|
|
16
|
+
}, f = (n, s = {}) => {
|
|
17
|
+
let e = "", r = "";
|
|
18
|
+
const t = Object.keys(s);
|
|
19
|
+
return t && t.length && t.forEach((o, l) => {
|
|
20
|
+
l === t.length - 1 ? r += `${o}=${s[o]}` : r += `${o}=${s[o]}&`;
|
|
21
|
+
}), r ? e = location.origin + n + `?${r}` : e = location.origin + n, e;
|
|
22
|
+
}, h = (n, s) => {
|
|
23
|
+
const e = s || location.href, r = i(e), t = Object.keys(r) || [];
|
|
24
|
+
if (!t || !t.length) return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
|
|
25
|
+
let o = t.filter((a) => !n.includes(a));
|
|
26
|
+
if (!o || !o.length) return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
|
|
27
|
+
let l = "";
|
|
28
|
+
return o.forEach((a, c) => {
|
|
29
|
+
c === t.length - 1 ? l += `${a}=${r[a]}` : l += `${a}=${r[a]}&`;
|
|
30
|
+
}), e.includes("?") ? e.split("?")[0] + `?${l}` : e.split("&")[0] + `?${l}`;
|
|
31
|
+
}, u = (n) => {
|
|
32
|
+
const s = new URLSearchParams(n.split("?")[1]), e = {};
|
|
33
|
+
for (const [r, t] of s)
|
|
34
|
+
e.hasOwnProperty(r) ? Array.isArray(e[r]) ? e[r].push(t) : e[r] = [e[r], t] : e[r] = t;
|
|
35
35
|
return e;
|
|
36
|
-
},
|
|
37
|
-
let
|
|
38
|
-
const e = Object.keys(
|
|
39
|
-
return e && e.length && e.forEach((
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
}, g = (n) => {
|
|
37
|
+
let s = "";
|
|
38
|
+
const e = Object.keys(n);
|
|
39
|
+
return e && e.length && e.forEach((r, t) => {
|
|
40
|
+
t === e.length - 1 ? s += `${r}=${n[r]}` : s += `${r}=${n[r]}&`;
|
|
41
|
+
}), s;
|
|
42
|
+
}, p = (n, s) => {
|
|
43
|
+
const e = new URL(n, location.origin);
|
|
44
|
+
let { origin: r, pathname: t } = e;
|
|
45
|
+
t === "/" && (t = ""), s.map((l) => t += `/${l}`);
|
|
46
|
+
const o = new URL(`${r}${t}`);
|
|
47
|
+
return e.searchParams.forEach((l, a) => {
|
|
48
|
+
o.searchParams.append(a, l);
|
|
49
|
+
}), o.toString();
|
|
47
50
|
};
|
|
48
|
-
function $(
|
|
49
|
-
const
|
|
51
|
+
function $(n) {
|
|
52
|
+
const s = /^(https?:\/\/[^/]+)/, e = n.match(s);
|
|
50
53
|
return e && e.length > 1 ? e[1] : null;
|
|
51
54
|
}
|
|
52
55
|
export {
|
|
53
|
-
|
|
56
|
+
p as addPathParamsToUrl,
|
|
54
57
|
h as funcUrlDel,
|
|
55
58
|
f as getFullPath,
|
|
56
59
|
$ as getOriginFromUrl,
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
i as getUrlParams,
|
|
61
|
+
g as objectToUrlparams,
|
|
59
62
|
u as urlParamsToObject
|
|
60
63
|
};
|
|
Binary file
|