@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
|
package/esm-map.json
CHANGED
|
@@ -143,5 +143,6 @@
|
|
|
143
143
|
"calcTextWidth": "/common-tools/calc-text-width/index",
|
|
144
144
|
"getFileExtension": "/common-tools/get-file-extension/index",
|
|
145
145
|
"getLanguages": "/common-info/index",
|
|
146
|
-
"appendQueryParams": "/common-tools/get-url-params/index"
|
|
146
|
+
"appendQueryParams": "/common-tools/get-url-params/index",
|
|
147
|
+
"refreshToken": "/create-api-service/sso/index"
|
|
147
148
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/utils",
|
|
3
|
-
"version": "7.1.0-dev.
|
|
3
|
+
"version": "7.1.0-dev.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@antv/x6": "^2.18.1",
|
|
12
|
-
"@das-fed/utils": "7.1.0-dev.
|
|
12
|
+
"@das-fed/utils": "7.1.0-dev.13",
|
|
13
13
|
"@vue/shared": "^3.4.21",
|
|
14
14
|
"@vueuse/core": "^9.6.0",
|
|
15
15
|
"axios": "^1.6.7",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"vue": "^3.4.21"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@das-fed/cli": "7.1.0-dev.
|
|
25
|
-
"@das-fed/web": "7.1.0-dev.
|
|
24
|
+
"@das-fed/cli": "7.1.0-dev.13",
|
|
25
|
+
"@das-fed/web": "7.1.0-dev.13",
|
|
26
26
|
"@types/js-cookie": "^3.0.6",
|
|
27
27
|
"@types/lodash-es": "^4.17.12",
|
|
28
28
|
"@types/qs": "^6.9.15",
|
package/token-tools/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
declare const expKey = "exp";
|
|
1
2
|
declare const accessTokenExpiredAtKey = "accessTokenExpiredAt";
|
|
3
|
+
declare const expiresInKey = "expires_in";
|
|
2
4
|
declare const refreshTokenKey = "refreshToken";
|
|
3
5
|
declare const redirectUriKey = "redirectUri";
|
|
4
6
|
declare const accessTokenInfoKey = "tokenInfo";
|
|
@@ -10,7 +12,8 @@ export declare const getAccessToken: () => string;
|
|
|
10
12
|
/**
|
|
11
13
|
* 获取tokenInfo相关信息
|
|
12
14
|
*/
|
|
13
|
-
|
|
15
|
+
type TokenInfoKey = typeof accessTokenExpiredAtKey | typeof refreshTokenKey | typeof redirectUriKey | typeof accessTokenInfoKey | typeof expKey | typeof expiresInKey;
|
|
16
|
+
export declare const getAccessTokenInfo: (key: TokenInfoKey) => any;
|
|
14
17
|
/**
|
|
15
18
|
* 存入token、tokenInfo
|
|
16
19
|
* @param token
|
package/token-tools/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*! js-cookie v3.0.5 | MIT */
|
|
2
|
-
function
|
|
2
|
+
function g(e) {
|
|
3
3
|
for (var t = 1; t < arguments.length; t++) {
|
|
4
4
|
var n = arguments[t];
|
|
5
|
-
for (var
|
|
6
|
-
e[
|
|
5
|
+
for (var l in n)
|
|
6
|
+
e[l] = n[l];
|
|
7
7
|
}
|
|
8
8
|
return e;
|
|
9
9
|
}
|
|
10
|
-
var
|
|
10
|
+
var x = {
|
|
11
11
|
read: function(e) {
|
|
12
12
|
return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
13
13
|
},
|
|
@@ -18,23 +18,23 @@ var k = {
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function m(e, t) {
|
|
22
22
|
function n(r, i, o) {
|
|
23
23
|
if (!(typeof document > "u")) {
|
|
24
|
-
o =
|
|
24
|
+
o = g({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
25
25
|
var c = "";
|
|
26
26
|
for (var s in o)
|
|
27
27
|
o[s] && (c += "; " + s, o[s] !== !0 && (c += "=" + o[s].split(";")[0]));
|
|
28
28
|
return document.cookie = r + "=" + e.write(i, r) + c;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function l(r) {
|
|
32
32
|
if (!(typeof document > "u" || arguments.length && !r)) {
|
|
33
33
|
for (var i = document.cookie ? document.cookie.split("; ") : [], o = {}, c = 0; c < i.length; c++) {
|
|
34
|
-
var s = i[c].split("="),
|
|
34
|
+
var s = i[c].split("="), k = s.slice(1).join("=");
|
|
35
35
|
try {
|
|
36
|
-
var
|
|
37
|
-
if (o[
|
|
36
|
+
var p = decodeURIComponent(s[0]);
|
|
37
|
+
if (o[p] = e.read(k, p), r === p)
|
|
38
38
|
break;
|
|
39
39
|
} catch {
|
|
40
40
|
}
|
|
@@ -45,21 +45,21 @@ function d(e, t) {
|
|
|
45
45
|
return Object.create(
|
|
46
46
|
{
|
|
47
47
|
set: n,
|
|
48
|
-
get:
|
|
48
|
+
get: l,
|
|
49
49
|
remove: function(r, i) {
|
|
50
50
|
n(
|
|
51
51
|
r,
|
|
52
52
|
"",
|
|
53
|
-
|
|
53
|
+
g({}, i, {
|
|
54
54
|
expires: -1
|
|
55
55
|
})
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
withAttributes: function(r) {
|
|
59
|
-
return
|
|
59
|
+
return m(this.converter, g({}, this.attributes, r));
|
|
60
60
|
},
|
|
61
61
|
withConverter: function(r) {
|
|
62
|
-
return
|
|
62
|
+
return m(g({}, this.converter, r), this.attributes);
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -68,16 +68,16 @@ function d(e, t) {
|
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
var
|
|
72
|
-
const a = "accessToken",
|
|
71
|
+
var f = m(x, { path: "/" });
|
|
72
|
+
const a = "accessToken", d = "exp", v = "accessTokenExpiredAt", I = "expires_in", u = "refreshToken", S = "redirectUri", T = "csrf-token", C = () => localStorage.getItem(a) ?? f.get(a) ?? sessionStorage.getItem(a) ?? "", U = (e) => localStorage.getItem(e) ?? f.get(e) ?? sessionStorage.getItem(e) ?? "", A = (e, t = {}) => {
|
|
73
73
|
var n;
|
|
74
|
-
(n = window.webConfig) != null && n.disableSaveToken || (localStorage.setItem(a, e), localStorage.setItem(
|
|
75
|
-
},
|
|
76
|
-
localStorage.removeItem(a), localStorage.removeItem(
|
|
74
|
+
(n = window.webConfig) != null && n.disableSaveToken || (localStorage.setItem(a, e), localStorage.setItem(d, t.exp ?? 0), localStorage.setItem(v, t.accessTokenExpiredAt ?? 0), localStorage.setItem(I, t.expires_in ?? 0), localStorage.setItem(u, t.refreshToken ?? 0), t.redirectUri && localStorage.setItem(S, t.redirectUri));
|
|
75
|
+
}, w = () => {
|
|
76
|
+
localStorage.removeItem(a), localStorage.removeItem(v), localStorage.removeItem(I), localStorage.removeItem(d), localStorage.removeItem(u), localStorage.removeItem(S), localStorage.removeItem(T);
|
|
77
77
|
};
|
|
78
78
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
C as getAccessToken,
|
|
80
|
+
U as getAccessTokenInfo,
|
|
81
|
+
w as removeAccessToken,
|
|
82
|
+
A as setAccessToken
|
|
83
83
|
};
|
package/token-tools/index.js.gz
CHANGED
|
Binary file
|