@das-fed/utils 6.3.0-beta.9 → 6.4.0-dev.2

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.
Files changed (39) hide show
  1. package/api-services/modules/file/index.d.ts +1 -1
  2. package/api-services/modules/file/index.js +253 -244
  3. package/api-services/modules/file/index.js.gz +0 -0
  4. package/common-info/set-personal-info/index.js +591 -565
  5. package/common-info/set-personal-info/index.js.gz +0 -0
  6. package/common-tools/date-format/index.js +2 -1
  7. package/common-tools/get-url-params/index.d.ts +1 -1
  8. package/common-tools/get-url-params/index.js +49 -46
  9. package/common-tools/get-url-params/index.js.gz +0 -0
  10. package/common-tools/update-fav-icon/index.js +1 -1
  11. package/create-api-service/index.js +1405 -1371
  12. package/create-api-service/index.js.gz +0 -0
  13. package/create-api-service/sso/index.js +739 -714
  14. package/create-api-service/sso/index.js.gz +0 -0
  15. package/curring-http/index.js +856 -830
  16. package/curring-http/index.js.gz +0 -0
  17. package/directive/auth/index.d.ts +8 -0
  18. package/directive/auth/index.js +62 -0
  19. package/directive/auth/index.js.gz +0 -0
  20. package/directive/clickOutside/index.d.ts +6 -0
  21. package/directive/clickOutside/index.js +27 -0
  22. package/directive/hoverInside/index.d.ts +6 -0
  23. package/directive/hoverInside/index.js +21 -0
  24. package/directive/utils/index.d.ts +7 -0
  25. package/directive/utils/index.js +7 -0
  26. package/esm-map.json +135 -5
  27. package/hooks/popup-manager/use-zindex/index.d.ts +5 -0
  28. package/hooks/popup-manager/use-zindex/index.js +22 -0
  29. package/hooks/use-get-auth/apis.d.ts +4 -0
  30. package/hooks/use-get-auth/index.d.ts +9 -0
  31. package/hooks/use-get-auth/index.js +53 -0
  32. package/hooks/use-get-auth/index.js.gz +0 -0
  33. package/package.json +5 -3
  34. package/pinyin-first-character/index.js +142 -132
  35. package/pinyin-first-character/index.js.gz +0 -0
  36. package/style/index.js +1 -1
  37. package/style/index.js.gz +0 -0
  38. package/vue/hooks/use-model-value/index.d.ts +5 -0
  39. package/vue/hooks/use-model-value/index.js +10 -0
@@ -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) new RegExp("(" + n + ")").test(t) && (t = t.replace(RegExp.$1, RegExp.$1.length === 1 ? r[n] : ("00" + r[n]).substr(("" + r[n]).length)));
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: any[]) => string;
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 a = (r, n) => {
1
+ const i = (n, s) => {
2
2
  let e = window.location.search || "";
3
- if (r && r !== location.href) {
4
- const s = r.indexOf("?");
5
- s !== -1 ? e = r.slice(s) : e = "";
3
+ if (n && n !== location.href) {
4
+ const t = n.indexOf("?");
5
+ t !== -1 ? e = n.slice(t) : e = "";
6
6
  }
7
- const t = new URLSearchParams(e);
8
- if (n)
9
- return t.get(n);
7
+ const r = new URLSearchParams(e);
8
+ if (s)
9
+ return r.get(s);
10
10
  {
11
- let s = {};
12
- for (let [l, c] of t.entries())
13
- s[l] = c;
14
- return s;
11
+ let t = {};
12
+ for (let [o, l] of r.entries())
13
+ t[o] = l;
14
+ return t;
15
15
  }
16
- }, f = (r, n = {}) => {
17
- let e = "", t = "";
18
- const s = Object.keys(n);
19
- return s && s.length && s.forEach((l, c) => {
20
- c === s.length - 1 ? t += `${l}=${n[l]}` : t += `${l}=${n[l]}&`;
21
- }), t ? e = location.origin + r + `?${t}` : e = location.origin + r, e;
22
- }, h = (r, n) => {
23
- const e = n || location.href, t = a(e), s = Object.keys(t) || [];
24
- if (!s || !s.length) return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
25
- let l = s.filter((i) => !r.includes(i));
26
- if (!l || !l.length) return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
27
- let c = "";
28
- return l.forEach((i, o) => {
29
- o === s.length - 1 ? c += `${i}=${t[i]}` : c += `${i}=${t[i]}&`;
30
- }), e.includes("?") ? e.split("?")[0] + `?${c}` : e.split("&")[0] + `?${c}`;
31
- }, u = (r) => {
32
- const n = new URLSearchParams(r.split("?")[1]), e = {};
33
- for (const [t, s] of n)
34
- e.hasOwnProperty(t) ? Array.isArray(e[t]) ? e[t].push(s) : e[t] = [e[t], s] : e[t] = s;
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
- }, p = (r) => {
37
- let n = "";
38
- const e = Object.keys(r);
39
- return e && e.length && e.forEach((t, s) => {
40
- s === e.length - 1 ? n += `${t}=${r[t]}` : n += `${t}=${r[t]}&`;
41
- }), n;
42
- }, g = (r, n) => {
43
- let e = r, t = "";
44
- return r.includes("?") && (e = r.split("?")[0], t = "?" + r.split("?")[1]), Object.values(n).forEach((s) => {
45
- e += `/${s}`;
46
- }), e = e.replace(/\/\//g, "/"), t && (e = e + t), e;
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 $(r) {
49
- const n = /^(https?:\/\/[^/]+)/, e = r.match(n);
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
- g as addPathParamsToUrl,
56
+ p as addPathParamsToUrl,
54
57
  h as funcUrlDel,
55
58
  f as getFullPath,
56
59
  $ as getOriginFromUrl,
57
- a as getUrlParams,
58
- p as objectToUrlparams,
60
+ i as getUrlParams,
61
+ g as objectToUrlparams,
59
62
  u as urlParamsToObject
60
63
  };
@@ -10,7 +10,7 @@ const c = m.get("/visitor/appearance/with-default", (t) => (t.public = !0, t)),
10
10
  if (!o) {
11
11
  const [r, e] = await c().run();
12
12
  if (r) return;
13
- const { browserLogoImgHost: n = "", browserLogoImg: a = "" } = e;
13
+ const { browserLogoImgHost: n = "", browserLogoImg: a = "" } = e || {};
14
14
  o = a ? n + l(a) : "";
15
15
  }
16
16
  i(o, t);