@das-fed/utils 7.0.0-zhaohang.7 → 7.0.0-zhongshen.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 (82) hide show
  1. package/api-services/index.js +1027 -984
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +917 -888
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/authentication/index.js +917 -888
  6. package/api-services/modules/authentication/index.js.gz +0 -0
  7. package/api-services/modules/bems/index.js +1032 -985
  8. package/api-services/modules/bems/index.js.gz +0 -0
  9. package/api-services/modules/contract/index.js +888 -877
  10. package/api-services/modules/contract/index.js.gz +0 -0
  11. package/api-services/modules/duty-manage/index.js +920 -891
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/enterpriseright/index.js +664 -631
  14. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  15. package/api-services/modules/file/index.js +896 -885
  16. package/api-services/modules/file/index.js.gz +0 -0
  17. package/api-services/modules/gateway-edge/index.js +917 -888
  18. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  19. package/api-services/modules/index.js +1099 -1052
  20. package/api-services/modules/index.js.gz +0 -0
  21. package/api-services/modules/iot/index.js +1084 -1073
  22. package/api-services/modules/iot/index.js.gz +0 -0
  23. package/api-services/modules/justauth/index.js +918 -889
  24. package/api-services/modules/justauth/index.js.gz +0 -0
  25. package/api-services/modules/knowledge/index.js +917 -888
  26. package/api-services/modules/knowledge/index.js.gz +0 -0
  27. package/api-services/modules/link/index.js +917 -888
  28. package/api-services/modules/link/index.js.gz +0 -0
  29. package/api-services/modules/permission/index.js +888 -877
  30. package/api-services/modules/permission/index.js.gz +0 -0
  31. package/api-services/modules/platformManage/index.js +1057 -1028
  32. package/api-services/modules/platformManage/index.js.gz +0 -0
  33. package/api-services/modules/portal/index.js +867 -838
  34. package/api-services/modules/portal/index.js.gz +0 -0
  35. package/api-services/modules/space-manage/index.js +888 -877
  36. package/api-services/modules/space-manage/index.js.gz +0 -0
  37. package/api-services/modules/super-admin/index.js +919 -890
  38. package/api-services/modules/super-admin/index.js.gz +0 -0
  39. package/api-services/modules/supplier/index.js +919 -890
  40. package/api-services/modules/supplier/index.js.gz +0 -0
  41. package/api-services/modules/supplychain-manage/index.js +917 -888
  42. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  43. package/api-services/modules/systemConfiguration/index.js +867 -838
  44. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  45. package/api-services/modules/tool/index.js +917 -888
  46. package/api-services/modules/tool/index.js.gz +0 -0
  47. package/api-services/src/create-service/index.js +916 -887
  48. package/api-services/src/create-service/index.js.gz +0 -0
  49. package/common-info/index.d.ts +2 -0
  50. package/common-info/index.js +17 -15
  51. package/common-info/index.js.gz +0 -0
  52. package/common-info/set-personal-info/index.d.ts +1 -1
  53. package/common-info/set-personal-info/index.js +253 -237
  54. package/common-info/set-personal-info/index.js.gz +0 -0
  55. package/common-info/type.d.ts +13 -7
  56. package/common-tools/extract-file-name/index.js +566 -550
  57. package/common-tools/extract-file-name/index.js.gz +0 -0
  58. package/common-tools/get-url-params/index.d.ts +8 -1
  59. package/common-tools/get-url-params/index.js +45 -38
  60. package/common-tools/get-url-params/index.js.gz +0 -0
  61. package/common-tools/platform-tools/index.d.ts +1 -1
  62. package/common-tools/platform-tools/index.js +22 -15
  63. package/create-api-service/index.d.ts +3 -1
  64. package/create-api-service/index.js +900 -889
  65. package/create-api-service/index.js.gz +0 -0
  66. package/create-api-service/sso/index.d.ts +3 -3
  67. package/create-api-service/sso/index.js +687 -650
  68. package/create-api-service/sso/index.js.gz +0 -0
  69. package/curring-http/index.js +798 -783
  70. package/curring-http/index.js.gz +0 -0
  71. package/curring-http/type.d.ts +3 -3
  72. package/esm-map.json +3 -1
  73. package/hooks/use-get-auth/index.d.ts +1 -1
  74. package/hooks/use-get-auth/index.js +30 -30
  75. package/hooks/use-get-auth/index.js.gz +0 -0
  76. package/package.json +4 -4
  77. package/process-engine-info/index.js +8 -7
  78. package/style/index.js +1 -1
  79. package/style/index.js.gz +0 -0
  80. package/token-tools/index.js +80 -8
  81. package/token-tools/index.js.gz +0 -0
  82. package/vue/hooks/use-model-value/index.d.ts +5 -1
@@ -13,7 +13,7 @@ export declare const getUrlParams: (allUrl?: string, queryName?: string) => any;
13
13
  */
14
14
  export declare const getFullPath: (url: string, queryObj?: any) => string;
15
15
  /**
16
- * 删除url中指定的参数,并返回最终的url
16
+ * 删除url中指定的参数,并返回最终的url(废弃,暂留)
17
17
  * @param queryNames 数组,需要删除的参数名集合
18
18
  * @param url 指定url
19
19
  * @returns
@@ -38,6 +38,13 @@ export declare const objectToUrlparams: (params: any) => string;
38
38
  * @returns
39
39
  */
40
40
  export declare const addPathParamsToUrl: (url: string, pathParams: string[]) => any;
41
+ /**
42
+ * 给url拼接query参数
43
+ * @param url 路径
44
+ * @param params 参数,object
45
+ * @returns
46
+ */
47
+ export declare function appendQueryParams(url: string, params: Record<string, any>): any;
41
48
  /**
42
49
  * 从URL中获取origin
43
50
  * @param url url
@@ -1,63 +1,70 @@
1
- const i = (n, s) => {
1
+ const l = (r, s) => {
2
2
  let e = window.location.search || "";
3
- if (n && n !== location.href) {
4
- const t = n.indexOf("?");
5
- t !== -1 ? e = n.slice(t) : e = "";
3
+ if (r && r !== location.href) {
4
+ const t = r.indexOf("?");
5
+ t !== -1 ? e = r.slice(t) : e = "";
6
6
  }
7
- const r = new URLSearchParams(e);
7
+ const n = new URLSearchParams(e);
8
8
  if (s)
9
- return r.get(s);
9
+ return n.get(s);
10
10
  {
11
11
  let t = {};
12
- for (let [o, l] of r.entries())
13
- t[o] = l;
12
+ for (let [o, a] of n.entries())
13
+ t[o] = a;
14
14
  return t;
15
15
  }
16
- }, f = (n, s = {}) => {
17
- let e = "", r = "";
16
+ }, f = (r, s = {}) => {
17
+ let e = "", n = "";
18
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) || [];
19
+ return t && t.length && t.forEach((o, a) => {
20
+ a === t.length - 1 ? n += `${o}=${s[o]}` : n += `${o}=${s[o]}&`;
21
+ }), n ? e = location.origin + r + `?${n}` : e = location.origin + r, e;
22
+ }, h = (r, s) => {
23
+ const e = s || location.href, n = l(e), t = Object.keys(n) || [];
24
24
  if (!t || !t.length) return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
25
- let o = t.filter((a) => !n.includes(a));
25
+ let o = t.filter((i) => !r.includes(i));
26
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;
27
+ let a = "";
28
+ return o.forEach((i, c) => {
29
+ c === t.length - 1 ? a += `${i}=${n[i]}` : a += `${i}=${n[i]}&`;
30
+ }), e.includes("?") ? e.split("?")[0] + `?${a}` : e.split("&")[0] + `?${a}`;
31
+ }, u = (r) => {
32
+ const s = new URLSearchParams(r.split("?")[1]), e = {};
33
+ for (const [n, t] of s)
34
+ e.hasOwnProperty(n) ? Array.isArray(e[n]) ? e[n].push(t) : e[n] = [e[n], t] : e[n] = t;
35
35
  return e;
36
- }, g = (n) => {
36
+ }, g = (r) => {
37
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]}&`;
38
+ const e = Object.keys(r);
39
+ return e && e.length && e.forEach((n, t) => {
40
+ t === e.length - 1 ? s += `${n}=${r[n]}` : s += `${n}=${r[n]}&`;
41
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);
42
+ }, p = (r, s) => {
43
+ const e = new URL(r, location.origin);
44
+ let { origin: n, pathname: t } = e;
45
+ t === "/" && (t = ""), s.map((a) => t += `/${a}`);
46
+ const o = new URL(`${n}${t}`);
47
+ return e.searchParams.forEach((a, i) => {
48
+ o.searchParams.append(i, a);
49
49
  }), o.toString();
50
50
  };
51
- function $(n) {
52
- const s = /^(https?:\/\/[^/]+)/, e = n.match(s);
51
+ function m(r, s) {
52
+ const e = new URL(r, window.location.origin);
53
+ return Object.entries(s).forEach(([n, t]) => {
54
+ e.searchParams.set(n, t);
55
+ }), e.toString();
56
+ }
57
+ function $(r) {
58
+ const s = /^(https?:\/\/[^/]+)/, e = r.match(s);
53
59
  return e && e.length > 1 ? e[1] : null;
54
60
  }
55
61
  export {
56
62
  p as addPathParamsToUrl,
63
+ m as appendQueryParams,
57
64
  h as funcUrlDel,
58
65
  f as getFullPath,
59
66
  $ as getOriginFromUrl,
60
- i as getUrlParams,
67
+ l as getUrlParams,
61
68
  g as objectToUrlparams,
62
69
  u as urlParamsToObject
63
70
  };
@@ -9,7 +9,7 @@ export declare const isRelativeOrSameDomain: (url: string) => boolean;
9
9
  * @param url
10
10
  * @returns
11
11
  */
12
- export declare const setShowLayout: (url: string) => string;
12
+ export declare const setShowLayout: (url: string) => any;
13
13
  export declare const setShowWatermark: (url: string) => string;
14
14
  /**
15
15
  * url携带token
@@ -1,19 +1,26 @@
1
- import { getToken as s } from "@das-fed/utils/common-info";
2
- const o = (e) => !!(!e.startsWith("http") || e.startsWith(location.origin)), n = (e) => {
3
- if (!e) return "";
4
- let t = e;
5
- return o(e) && !e.includes("showLayout=false") && (t = e.indexOf("?") !== -1 ? e + "&showLayout=false" : e + "?showLayout=false"), t;
6
- }, i = (e) => {
7
- if (!e) return "";
8
- let t = "";
9
- return o(e) && !e.includes("showWatermark=false") ? t = e.indexOf("?") !== -1 ? e + "&showWatermark=false" : e + "?showWatermark=false" : t = e, t;
10
- }, r = (e) => {
11
- const t = s();
12
- return e.includes("?") ? `${e}&token=${t}` : `${e}?token=${t}`;
1
+ import { getToken as n } from "@das-fed/utils/common-info";
2
+ const o = (t) => {
3
+ try {
4
+ return new URL(t, location.origin).origin === location.origin;
5
+ } catch {
6
+ return !0;
7
+ }
8
+ }, r = (t) => {
9
+ if (!t) return "";
10
+ if (!o(t)) return t;
11
+ const e = new URL(t, location.origin);
12
+ return e.searchParams.has("showLayout") || e.searchParams.set("showLayout", "false"), e.toString();
13
+ }, s = (t) => {
14
+ if (!t) return "";
15
+ let e = "";
16
+ return o(t) && !t.includes("showWatermark=false") ? e = t.indexOf("?") !== -1 ? t + "&showWatermark=false" : t + "?showWatermark=false" : e = t, e;
17
+ }, i = (t) => {
18
+ const e = n();
19
+ return t.includes("?") ? `${t}&token=${e}` : `${t}?token=${e}`;
13
20
  };
14
21
  export {
15
22
  o as isRelativeOrSameDomain,
16
- n as setShowLayout,
17
- i as setShowWatermark,
18
- r as withToken
23
+ r as setShowLayout,
24
+ s as setShowWatermark,
25
+ i as withToken
19
26
  };
@@ -1 +1,3 @@
1
- export declare const createService: (urlPrefix: string, customConfig?: any) => any;
1
+ import { CurringConfigFun } from '../curring-http/type';
2
+
3
+ export declare const createService: (urlPrefix: string, customConfig?: CurringConfigFun) => any;