@das-fed/utils 7.1.0-dev.11 → 7.1.0-dev.13
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/modules/app-manage/index.js +743 -725
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +746 -728
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +702 -716
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +984 -1002
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +726 -744
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +725 -743
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +727 -745
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +702 -716
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +743 -725
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- 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/sso/index.d.ts +9 -6
- package/create-api-service/sso/index.js +207 -193
- package/create-api-service/sso/index.js.gz +0 -0
- package/esm-map.json +2 -1
- package/package.json +4 -4
- package/token-tools/index.d.ts +4 -1
- package/token-tools/index.js +23 -23
- package/token-tools/index.js.gz +0 -0
|
Binary file
|
|
@@ -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
|
|
@@ -5,18 +5,21 @@ declare const getTokenParams: any;
|
|
|
5
5
|
declare const getTokenFromCode: () => unknown;
|
|
6
6
|
declare const getToken: (config: any) => unknown;
|
|
7
7
|
declare const login: (_params: any) => any;
|
|
8
|
+
declare const refreshToken: (params: any) => unknown;
|
|
8
9
|
declare const tokenStorage: () => {
|
|
9
10
|
getData: () => {
|
|
10
11
|
accessToken: any;
|
|
11
|
-
|
|
12
|
+
exp: any;
|
|
12
13
|
refreshToken: any;
|
|
13
14
|
};
|
|
14
15
|
save: (data: {
|
|
15
|
-
accessToken
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
accessToken: string | null;
|
|
17
|
+
exp: number;
|
|
18
|
+
accessTokenExpiredAt: number;
|
|
19
|
+
expires_in: number;
|
|
20
|
+
refreshToken: string | null;
|
|
21
|
+
info: any;
|
|
19
22
|
}) => void;
|
|
20
23
|
remove: () => void;
|
|
21
24
|
};
|
|
22
|
-
export { getTokenParams, getTokenFromCode, real_uri, getQuery, getToken, tokenStorage, login };
|
|
25
|
+
export { getTokenParams, getTokenFromCode, real_uri, getQuery, getToken, tokenStorage, login, refreshToken };
|