@gct-paas/core 0.0.1-dev.21 → 0.0.1-dev.23
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/dist/index.min.cjs +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/constants/core.d.ts +1 -0
- package/es/constants/core.mjs +2 -1
- package/es/index.mjs +1 -1
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.mjs +1 -1
- package/es/utils/tools/tools.d.ts +14 -0
- package/es/utils/tools/tools.mjs +11 -1
- package/package.json +4 -4
package/es/constants/core.d.ts
CHANGED
package/es/constants/core.mjs
CHANGED
package/es/index.mjs
CHANGED
|
@@ -72,7 +72,7 @@ export { DictionaryUtil } from './utils/dictionary/dictionary.mjs';
|
|
|
72
72
|
export { Namespace } from './utils/namespace/namespace.mjs';
|
|
73
73
|
export { PluginPgkUtil } from './utils/plugin-pkg-util/plugin-pkg-util.mjs';
|
|
74
74
|
export { PluginStaticResource } from './utils/plugin-static-resource/plugin-static-resource.mjs';
|
|
75
|
-
export { deepMerge, getToken, setToken } from './utils/tools/tools.mjs';
|
|
75
|
+
export { deepMerge, getPathQuery, getTenant, getTimezone, getToken, isMobile, setTenant, setToken } from './utils/tools/tools.mjs';
|
|
76
76
|
export { widthEditorInstall } from './utils/width-install/width-install.mjs';
|
|
77
77
|
|
|
78
78
|
"use strict";
|
package/es/utils/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export { DictionaryUtil } from './dictionary/dictionary';
|
|
|
3
3
|
export { Namespace } from './namespace/namespace';
|
|
4
4
|
export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
|
|
5
5
|
export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
|
|
6
|
-
export { deepMerge, getToken, setToken } from './tools/tools';
|
|
6
|
+
export { deepMerge, getToken, setToken, getPathQuery, getTenant, getTimezone, isMobile, setTenant, } from './tools/tools';
|
|
7
7
|
export { widthEditorInstall } from './width-install/width-install';
|
package/es/utils/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ export { DictionaryUtil } from './dictionary/dictionary.mjs';
|
|
|
3
3
|
export { Namespace } from './namespace/namespace.mjs';
|
|
4
4
|
export { PluginPgkUtil } from './plugin-pkg-util/plugin-pkg-util.mjs';
|
|
5
5
|
export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource.mjs';
|
|
6
|
-
export { deepMerge, getToken, setToken } from './tools/tools.mjs';
|
|
6
|
+
export { deepMerge, getPathQuery, getTenant, getTimezone, getToken, isMobile, setTenant, setToken } from './tools/tools.mjs';
|
|
7
7
|
export { widthEditorInstall } from './width-install/width-install.mjs';
|
|
8
8
|
|
|
9
9
|
"use strict";
|
|
@@ -23,6 +23,20 @@ export declare function getToken(): string | null;
|
|
|
23
23
|
* @param {string} token
|
|
24
24
|
*/
|
|
25
25
|
export declare function setToken(token: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* 从 cookie 获取租户标识
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
* @returns {*} {(string | null)}
|
|
31
|
+
*/
|
|
32
|
+
export declare function getTenant(): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* 设置租户标识至 cookie
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
* @param {string} tenant
|
|
38
|
+
*/
|
|
39
|
+
export declare function setTenant(tenant: string): void;
|
|
26
40
|
/**
|
|
27
41
|
* 获取路径参数
|
|
28
42
|
*
|
package/es/utils/tools/tools.mjs
CHANGED
|
@@ -31,6 +31,16 @@ function setToken(token) {
|
|
|
31
31
|
clearCookie(CoreConst.TOKEN);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
function getTenant() {
|
|
35
|
+
return getCookie(CoreConst.TENANT);
|
|
36
|
+
}
|
|
37
|
+
function setTenant(tenant) {
|
|
38
|
+
if (tenant) {
|
|
39
|
+
setCookie(CoreConst.TENANT, tenant, 0, true);
|
|
40
|
+
} else {
|
|
41
|
+
clearCookie(CoreConst.TENANT);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
function getPathQuery() {
|
|
35
45
|
const params = location.pathname.replace("/src/projects", "").split("/");
|
|
36
46
|
return {
|
|
@@ -49,4 +59,4 @@ function getTimezone() {
|
|
|
49
59
|
return localStorage.getItem(TIMEZONE_KEY) || "UTC+08:00";
|
|
50
60
|
}
|
|
51
61
|
|
|
52
|
-
export { deepMerge, getPathQuery, getTimezone, getToken, isMobile, setToken };
|
|
62
|
+
export { deepMerge, getPathQuery, getTenant, getTimezone, getToken, isMobile, setTenant, setToken };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"main": "dist/index.min.cjs",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"vue-i18n": "9.6.5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@gct-paas/build": "0.0.1-dev.
|
|
60
|
-
"@gct-paas/cli": "0.0.1-dev.
|
|
59
|
+
"@gct-paas/build": "0.0.1-dev.23",
|
|
60
|
+
"@gct-paas/cli": "0.0.1-dev.23",
|
|
61
61
|
"@types/path-browserify": "^1.0.3",
|
|
62
62
|
"@types/qs": "^6.9.18",
|
|
63
63
|
"fs-extra": "^11.3.0"
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"vue": "^3.x"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "edbd8d546d224769719d37be656e7b5a6e5e5197"
|
|
69
69
|
}
|