@das-fed/utils 7.0.5-beta.8 → 7.0.5-beta.8.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.
- package/api-services/index.js +1000 -965
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +851 -853
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +192 -176
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +854 -856
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +851 -853
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +758 -724
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +780 -768
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +178 -162
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +851 -853
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +643 -626
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +1100 -1102
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.d.ts +1 -1
- package/api-services/modules/justauth/index.js +852 -853
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +192 -176
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +192 -176
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +192 -176
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +276 -260
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +192 -176
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +851 -853
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +207 -191
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +853 -855
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +851 -853
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +851 -853
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +192 -176
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +850 -852
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/index.d.ts +1 -1
- package/common-info/set-personal-info/index.d.ts +1 -1
- package/common-info/set-personal-info/index.js +10 -10
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-tools/get-url-params/index.d.ts +7 -0
- package/common-tools/get-url-params/index.js +45 -38
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/common-tools/obj-tools/index.js +1 -1
- package/common-tools/platform-tools/index.d.ts +7 -2
- package/common-tools/platform-tools/index.js +27 -15
- package/common-tools/platform-tools/index.js.gz +0 -0
- package/create-api-service/index.js +308 -292
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/authorizer.d.ts +1 -0
- package/create-api-service/sso/index.d.ts +10 -8
- package/create-api-service/sso/index.js +874 -761
- package/create-api-service/sso/index.js.gz +0 -0
- package/create-api-service/sso/utils.d.ts +2 -0
- package/create-api-service/thirdLogout/index.d.ts +19 -0
- package/create-api-service/thirdLogout/index.js +1834 -0
- package/create-api-service/thirdLogout/index.js.gz +0 -0
- package/create-api-service/unauthorized-recovery/index.d.ts +30 -0
- package/create-api-service/unauthorized-recovery/index.js +10 -0
- package/curring-http/type.d.ts +6 -0
- package/esm-map.json +10 -1
- package/package.json +4 -4
- package/process-engine-info/index.js +8 -7
- package/token-tools/index.d.ts +2 -1
- package/token-tools/index.js +80 -8
- package/token-tools/index.js.gz +0 -0
|
Binary file
|
package/common-info/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, PersonalConfigInfo, ProjectInfo, ProjectMessage, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
|
|
2
2
|
|
|
3
3
|
/** 获取token */
|
|
4
|
-
export declare const getToken:
|
|
4
|
+
export declare const getToken: () => string;
|
|
5
5
|
/** 获取账户详情 */
|
|
6
6
|
export declare const getUserInfo: () => UserInfo;
|
|
7
7
|
/** 获取用户详情 */
|
|
@@ -1712,25 +1712,25 @@ const {
|
|
|
1712
1712
|
formToJSON: Gn,
|
|
1713
1713
|
getAdapter: Qn,
|
|
1714
1714
|
mergeConfig: Zn
|
|
1715
|
-
} = E, Yn = async (e) => {
|
|
1716
|
-
var
|
|
1715
|
+
} = E, Yn = async (e = "") => {
|
|
1716
|
+
var r;
|
|
1717
1717
|
const t = {
|
|
1718
1718
|
personalInfo: "/api/personal-center/personal-server/v1/info"
|
|
1719
|
+
}, n = {
|
|
1720
|
+
"X-Origin": location.origin,
|
|
1721
|
+
"Accept-Language": Ze.value
|
|
1719
1722
|
};
|
|
1723
|
+
e && (n.Authorization = `Bearer ${e}`);
|
|
1720
1724
|
try {
|
|
1721
|
-
const
|
|
1725
|
+
const s = await E.create().get(t.personalInfo, {
|
|
1722
1726
|
baseURL: et().baseURL,
|
|
1723
1727
|
params: {
|
|
1724
|
-
project: (
|
|
1728
|
+
project: (r = Ye()) == null ? void 0 : r.id,
|
|
1725
1729
|
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
1726
1730
|
},
|
|
1727
|
-
headers:
|
|
1728
|
-
Authorization: `Bearer ${e}`,
|
|
1729
|
-
"X-Origin": location.origin,
|
|
1730
|
-
"Accept-Language": Ze.value
|
|
1731
|
-
}
|
|
1731
|
+
headers: n
|
|
1732
1732
|
});
|
|
1733
|
-
|
|
1733
|
+
s != null && s.data && sessionStorage.setItem("userInfo", JSON.stringify(s.data));
|
|
1734
1734
|
} catch {
|
|
1735
1735
|
}
|
|
1736
1736
|
};
|
|
Binary file
|
|
@@ -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
|
|
1
|
+
const l = (r, s) => {
|
|
2
2
|
let e = window.location.search || "";
|
|
3
|
-
if (
|
|
4
|
-
const t =
|
|
5
|
-
t !== -1 ? e =
|
|
3
|
+
if (r && r !== location.href) {
|
|
4
|
+
const t = r.indexOf("?");
|
|
5
|
+
t !== -1 ? e = r.slice(t) : e = "";
|
|
6
6
|
}
|
|
7
|
-
const
|
|
7
|
+
const n = new URLSearchParams(e);
|
|
8
8
|
if (s)
|
|
9
|
-
return
|
|
9
|
+
return n.get(s);
|
|
10
10
|
{
|
|
11
11
|
let t = {};
|
|
12
|
-
for (let [o,
|
|
13
|
-
t[o] =
|
|
12
|
+
for (let [o, a] of n.entries())
|
|
13
|
+
t[o] = a;
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
16
|
-
}, f = (
|
|
17
|
-
let e = "",
|
|
16
|
+
}, f = (r, s = {}) => {
|
|
17
|
+
let e = "", n = "";
|
|
18
18
|
const t = Object.keys(s);
|
|
19
|
-
return t && t.length && t.forEach((o,
|
|
20
|
-
|
|
21
|
-
}),
|
|
22
|
-
}, h = (
|
|
23
|
-
const e = s || location.href,
|
|
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((
|
|
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
|
|
28
|
-
return o.forEach((
|
|
29
|
-
c === t.length - 1 ?
|
|
30
|
-
}), e.includes("?") ? e.split("?")[0] + `?${
|
|
31
|
-
}, u = (
|
|
32
|
-
const s = new URLSearchParams(
|
|
33
|
-
for (const [
|
|
34
|
-
e.hasOwnProperty(
|
|
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 = (
|
|
36
|
+
}, g = (r) => {
|
|
37
37
|
let s = "";
|
|
38
|
-
const e = Object.keys(
|
|
39
|
-
return e && e.length && e.forEach((
|
|
40
|
-
t === e.length - 1 ? s += `${
|
|
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 = (
|
|
43
|
-
const e = new URL(
|
|
44
|
-
let { origin:
|
|
45
|
-
t === "/" && (t = ""), s.map((
|
|
46
|
-
const o = new URL(`${
|
|
47
|
-
return e.searchParams.forEach((
|
|
48
|
-
o.searchParams.append(
|
|
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
|
|
52
|
-
const
|
|
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
|
-
|
|
67
|
+
l as getUrlParams,
|
|
61
68
|
g as objectToUrlparams,
|
|
62
69
|
u as urlParamsToObject
|
|
63
70
|
};
|
|
Binary file
|
|
@@ -4,7 +4,7 @@ const f = (t, r) => {
|
|
|
4
4
|
if (r[e] === void 0) return !1;
|
|
5
5
|
if (typeof r[e] == "function" || typeof t[e] == "function") throw new Error("type error");
|
|
6
6
|
if (typeof r[e] != typeof t[e]) return !1;
|
|
7
|
-
if (typeof t[e] == "object") return f(t[e], r[e]);
|
|
7
|
+
if (t[e] !== null && typeof t[e] == "object") return f(t[e], r[e]);
|
|
8
8
|
if (t[e] !== r[e]) return !1;
|
|
9
9
|
}
|
|
10
10
|
return !0;
|
|
@@ -5,12 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const isRelativeOrSameDomain: (url: string) => boolean;
|
|
7
7
|
/**
|
|
8
|
-
* 自动拼接上showLayout=false
|
|
8
|
+
* 自动拼接上showLayout=false 和 ignoreAuth = true
|
|
9
9
|
* @param url
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
12
|
export declare const setShowLayout: (url: string) => any;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* 设置水印显示参数
|
|
15
|
+
* @param url
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const setShowWatermark: (url: string) => any;
|
|
14
19
|
/**
|
|
15
20
|
* url携带token
|
|
16
21
|
* @param url
|
|
@@ -1,26 +1,38 @@
|
|
|
1
|
-
import { getToken as
|
|
2
|
-
const
|
|
1
|
+
import { getToken as r } from "@das-fed/utils/common-info";
|
|
2
|
+
const s = (t) => {
|
|
3
3
|
try {
|
|
4
4
|
return new URL(t, location.origin).origin === location.origin;
|
|
5
5
|
} catch {
|
|
6
6
|
return !0;
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, h = (t) => {
|
|
9
9
|
if (!t) return "";
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
if (!s(t)) return t;
|
|
11
|
+
try {
|
|
12
|
+
const e = new URL(t, location.origin);
|
|
13
|
+
return e.searchParams.has("showLayout") || e.searchParams.set("showLayout", "false"), e.searchParams.has("ignoreAuth") || e.searchParams.set("ignoreAuth", "true"), e.toString();
|
|
14
|
+
} catch {
|
|
15
|
+
const e = /([?&])showLayout=/.test(t), a = /([?&])ignoreAuth=/.test(t), o = [];
|
|
16
|
+
if (e || o.push("showLayout=false"), a || o.push("ignoreAuth=true"), o.length === 0) return t;
|
|
17
|
+
const n = t.includes("?") ? "&" : "?";
|
|
18
|
+
return t + n + o.join("&");
|
|
19
|
+
}
|
|
20
|
+
}, c = (t) => {
|
|
14
21
|
if (!t) return "";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
if (!s(t)) return t;
|
|
23
|
+
try {
|
|
24
|
+
const e = new URL(t, location.origin);
|
|
25
|
+
return e.searchParams.get("showWatermark") !== "false" && e.searchParams.set("showWatermark", "false"), e.toString();
|
|
26
|
+
} catch {
|
|
27
|
+
return t.includes("showWatermark=false") ? t : t.indexOf("?") !== -1 ? t + "&showWatermark=false" : t + "?showWatermark=false";
|
|
28
|
+
}
|
|
29
|
+
}, f = (t) => {
|
|
30
|
+
const e = r();
|
|
19
31
|
return t.includes("?") ? `${t}&token=${e}` : `${t}?token=${e}`;
|
|
20
32
|
};
|
|
21
33
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
s as isRelativeOrSameDomain,
|
|
35
|
+
h as setShowLayout,
|
|
36
|
+
c as setShowWatermark,
|
|
37
|
+
f as withToken
|
|
26
38
|
};
|
|
Binary file
|