@das-fed/utils 6.3.0-beta.3 → 6.3.0-beta.4
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/__VLS_types.d.ts +124 -0
- package/api-services/modules/app-manage/index.d.ts +2 -0
- package/api-services/modules/app-manage/index.js +5 -0
- package/api-services/modules/authentication/index.d.ts +2 -0
- package/api-services/modules/authentication/index.js +5 -0
- package/api-services/modules/bems/index.d.ts +6 -0
- package/api-services/modules/bems/index.js +9 -0
- package/api-services/modules/contract/index.d.ts +2 -0
- package/api-services/modules/contract/index.js +5 -0
- package/api-services/modules/duty-manage/index.d.ts +7 -0
- package/api-services/modules/duty-manage/index.js +14 -0
- package/api-services/modules/enterpriseright/index.d.ts +2 -0
- package/api-services/modules/enterpriseright/index.js +5 -0
- package/api-services/modules/file/index.d.ts +36 -0
- package/api-services/modules/file/index.js +499 -0
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.d.ts +2 -0
- package/api-services/modules/gateway-edge/index.js +5 -0
- package/api-services/modules/index.d.ts +21 -0
- package/api-services/modules/index.js +59 -0
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.d.ts +15 -0
- package/api-services/modules/iot/index.js +18 -0
- package/api-services/modules/justauth/index.d.ts +3 -0
- package/api-services/modules/justauth/index.js +6 -0
- package/api-services/modules/knowledge/index.d.ts +2 -0
- package/api-services/modules/knowledge/index.js +5 -0
- package/api-services/modules/link/index.d.ts +2 -0
- package/api-services/modules/link/index.js +5 -0
- package/api-services/modules/permission/index.d.ts +2 -0
- package/api-services/modules/permission/index.js +5 -0
- package/api-services/modules/platformManage/index.d.ts +14 -0
- package/api-services/modules/platformManage/index.js +13 -0
- package/api-services/modules/portal/index.d.ts +2 -0
- package/api-services/modules/portal/index.js +5 -0
- package/api-services/modules/space-manage/index.d.ts +2 -0
- package/api-services/modules/space-manage/index.js +5 -0
- package/api-services/modules/super-admin/index.d.ts +8 -0
- package/api-services/modules/super-admin/index.js +8 -0
- package/api-services/modules/supplier/index.d.ts +6 -0
- package/api-services/modules/supplier/index.js +7 -0
- package/api-services/modules/supplychain-manage/index.d.ts +2 -0
- package/api-services/modules/supplychain-manage/index.js +5 -0
- package/api-services/modules/systemConfiguration/index.d.ts +2 -0
- package/api-services/modules/systemConfiguration/index.js +5 -0
- package/api-services/modules/tool/index.d.ts +2 -0
- package/api-services/modules/tool/index.js +5 -0
- package/api-services/src/create-service/index.d.ts +1 -0
- package/api-services/src/create-service/index.js +4 -0
- package/common-info/getIframeUrl/index.d.ts +9 -0
- package/common-info/getIframeUrl/index.js +10 -0
- package/common-info/getInfoFromUrl/index.d.ts +8 -0
- package/common-info/getInfoFromUrl/index.js +84 -0
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/set-personal-info/index.d.ts +5 -0
- package/common-info/set-personal-info/index.js +1664 -0
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +104 -0
- package/common-tools/arr-tools/index.d.ts +15 -0
- package/common-tools/arr-tools/index.js +8 -0
- package/common-tools/date-format/index.d.ts +7 -0
- package/common-tools/date-format/index.js +18 -0
- package/common-tools/get-url-params/index.d.ts +46 -0
- package/common-tools/get-url-params/index.js +60 -0
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/common-tools/handle-data/index.d.ts +6 -0
- package/common-tools/handle-data/index.js +4 -0
- package/common-tools/nest-tree-format/index.d.ts +30 -0
- package/common-tools/nest-tree-format/index.js +24 -0
- package/common-tools/obj-tools/index.d.ts +7 -0
- package/common-tools/obj-tools/index.js +14 -0
- package/common-tools/platform-tools/index.d.ts +18 -0
- package/common-tools/platform-tools/index.js +14 -0
- package/common-tools/queue-promise/index.d.ts +6 -0
- package/common-tools/queue-promise/index.js +9 -0
- package/common-tools/setHtmlMinWH/index.d.ts +5 -0
- package/common-tools/setHtmlMinWH/index.js +11 -0
- package/common-tools/update-fav-icon/index.d.ts +11 -0
- package/common-tools/update-fav-icon/index.js +21 -0
- package/create-api-service/proxy-sso/index.d.ts +3 -0
- package/create-api-service/proxy-sso/index.js +21 -0
- package/create-api-service/sso/index.d.ts +23 -0
- package/create-api-service/sso/index.js +1946 -0
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/type.d.ts +89 -0
- package/esm-map.json +5 -5
- package/package.json +3 -3
- package/webSocket-service/type.d.ts +28 -0
|
Binary file
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export interface UserInfo {
|
|
2
|
+
/** 用户id */
|
|
3
|
+
id: string
|
|
4
|
+
/** 用户名称 */
|
|
5
|
+
name: string
|
|
6
|
+
/** 用户标识 2 - B端身份, 4 - C 端身份, 6 - B+C 端身份 */
|
|
7
|
+
flag: number
|
|
8
|
+
/** 租户id */
|
|
9
|
+
tenantId: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface PersonalInfo {
|
|
13
|
+
/** id */
|
|
14
|
+
id: string
|
|
15
|
+
/** 名称 */
|
|
16
|
+
name: string
|
|
17
|
+
/** 手机号 */
|
|
18
|
+
phone: string
|
|
19
|
+
/** 用户名称 */
|
|
20
|
+
userName: string
|
|
21
|
+
/** 邮箱 */
|
|
22
|
+
email: string
|
|
23
|
+
/** 头像 */
|
|
24
|
+
headPicture: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface TenantInfo {
|
|
28
|
+
/** 用户ID */
|
|
29
|
+
userId: string
|
|
30
|
+
/** 用户名 */
|
|
31
|
+
userName: string
|
|
32
|
+
name: string
|
|
33
|
+
/** 租户信息 */
|
|
34
|
+
tenant: {
|
|
35
|
+
id: string
|
|
36
|
+
name: string
|
|
37
|
+
adminUserId: string
|
|
38
|
+
description: string
|
|
39
|
+
domain: string
|
|
40
|
+
}
|
|
41
|
+
/** 用户标识 2 - B端身份, 4 - C 端身份, 6 - B+C 端身份 */
|
|
42
|
+
flag: number
|
|
43
|
+
areaCode: string
|
|
44
|
+
/** 手机号 */
|
|
45
|
+
phone: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface HomeInfo {
|
|
49
|
+
applicationCode: string
|
|
50
|
+
applicationPath: string
|
|
51
|
+
enable: boolean
|
|
52
|
+
originalCode: string
|
|
53
|
+
routeUrl: string
|
|
54
|
+
type: number | null
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ProjectInfo {
|
|
58
|
+
/** 项目id */
|
|
59
|
+
id: string | number
|
|
60
|
+
/** 父级id */
|
|
61
|
+
parentId?: string
|
|
62
|
+
/** 项目名称 */
|
|
63
|
+
name: string
|
|
64
|
+
/** 租户id */
|
|
65
|
+
tenantId?: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface SubAppsInfo {
|
|
69
|
+
/** 所有应用信息 */
|
|
70
|
+
appcategorys?: any[]
|
|
71
|
+
/** 当前应用完整信息 */
|
|
72
|
+
currentSubApp?: any
|
|
73
|
+
/** 所有应用 */
|
|
74
|
+
flatSubAppList?: any[]
|
|
75
|
+
/** 当前应用code */
|
|
76
|
+
currentSubAppCode?: string
|
|
77
|
+
/** 当前打开的应用 */
|
|
78
|
+
subAppList?: any[]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface TabItem {
|
|
82
|
+
/** 当前应用url */
|
|
83
|
+
currentApplication: string
|
|
84
|
+
/** 当前加载的应用 */
|
|
85
|
+
applicationPath: string
|
|
86
|
+
applicationCode: string
|
|
87
|
+
menuId: string
|
|
88
|
+
name: string
|
|
89
|
+
path: string
|
|
90
|
+
code: string
|
|
91
|
+
query?: any
|
|
92
|
+
}
|
|
93
|
+
export interface TabInfo {
|
|
94
|
+
/** 当前tabs key */
|
|
95
|
+
currentCode?: string
|
|
96
|
+
/** 当前tabs */
|
|
97
|
+
currentTab?: TabItem
|
|
98
|
+
/** 用于记录该应用上次开启的tab */
|
|
99
|
+
preTab?: Record<string, TabItem>
|
|
100
|
+
/** 当前打开的tabs(微前端环境会存入) */
|
|
101
|
+
tabMap?: Record<string, TabItem[]>
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type permissionBtnInfo = { code?: string; name?: string }[]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断两个数组是否内容相等
|
|
3
|
+
* @param a 数组一
|
|
4
|
+
* @param b 数组二
|
|
5
|
+
* @param isSort 是否排序完成之后再比较,也就是顺序无关,默认为true
|
|
6
|
+
* @returns 是否相等
|
|
7
|
+
*/
|
|
8
|
+
export declare const arrEqual: (a: any[], b: any[], isSort?: boolean) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 根据数组对象的某个字段去重
|
|
11
|
+
* @param arr 需要处理的数组
|
|
12
|
+
* @param val 要根据哪个字段来去重
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const arrUnique: (arr: any[], val: string) => any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const o = (t, r, e = !0) => t.length !== r.length ? !1 : e ? t.sort().toString() === r.sort().toString() : t.toString() === r.toString(), s = (t, r) => {
|
|
2
|
+
const e = /* @__PURE__ */ new Map();
|
|
3
|
+
return t.filter((n) => !e.has(n[r]) && e.set(n[r], 1));
|
|
4
|
+
};
|
|
5
|
+
export {
|
|
6
|
+
o as arrEqual,
|
|
7
|
+
s as arrUnique
|
|
8
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const a = (s, t = "yyyy-MM-dd HH:mm:ss") => {
|
|
2
|
+
let e = s ? new Date(s) : /* @__PURE__ */ new Date();
|
|
3
|
+
var r = {
|
|
4
|
+
"M+": e.getMonth() + 1,
|
|
5
|
+
"d+": e.getDate(),
|
|
6
|
+
"H+": e.getHours(),
|
|
7
|
+
"m+": e.getMinutes(),
|
|
8
|
+
"s+": e.getSeconds(),
|
|
9
|
+
"q+": Math.floor((e.getMonth() + 3) / 3),
|
|
10
|
+
S: e.getMilliseconds()
|
|
11
|
+
}, g = e.getFullYear().toString();
|
|
12
|
+
g = g.length >= 4 ? g : "0000".substr(0, 4 - g.length) + g, /(y+)/.test(t) && (t = t.replace(RegExp.$1, (g + "").substr(4 - RegExp.$1.length)));
|
|
13
|
+
for (var n in r) new RegExp("(" + n + ")").test(t) && (t = t.replace(RegExp.$1, RegExp.$1.length === 1 ? r[n] : ("00" + r[n]).substr(("" + r[n]).length)));
|
|
14
|
+
return t;
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
a as dateFormat
|
|
18
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取url中的参数
|
|
3
|
+
* @param url url地址
|
|
4
|
+
* @param queryName 参数名称,不传则返回参数集合
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const getUrlParams: (allUrl?: string, queryName?: string) => any;
|
|
8
|
+
/**
|
|
9
|
+
* 拼接完整的url
|
|
10
|
+
* @param url pathname
|
|
11
|
+
* @param queryObj 参数集合
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const getFullPath: (url: string, queryObj?: any) => string;
|
|
15
|
+
/**
|
|
16
|
+
* 删除url中指定的参数,并返回最终的url
|
|
17
|
+
* @param queryNames 数组,需要删除的参数名集合
|
|
18
|
+
* @param url 指定url
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare const funcUrlDel: (queryNames: string[], url?: string) => string;
|
|
22
|
+
/**
|
|
23
|
+
* 将url中的query参数转换成对象
|
|
24
|
+
* @param url url链接,域名可带可不带
|
|
25
|
+
* @returns params url链接参数转化的Object
|
|
26
|
+
*/
|
|
27
|
+
export declare const urlParamsToObject: (url: string) => any;
|
|
28
|
+
/**
|
|
29
|
+
* 将对象转换成url中的query参数
|
|
30
|
+
* @param params 参数对象
|
|
31
|
+
* @returns url形式的参数
|
|
32
|
+
*/
|
|
33
|
+
export declare const objectToUrlparams: (params: any) => string;
|
|
34
|
+
/**
|
|
35
|
+
* 给url拼接params参数
|
|
36
|
+
* @param url 路径
|
|
37
|
+
* @param pathParams 参数,数组格式
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
export declare const addPathParamsToUrl: (url: string, pathParams: any[]) => string;
|
|
41
|
+
/**
|
|
42
|
+
* 从URL中获取origin
|
|
43
|
+
* @param url url
|
|
44
|
+
* @returns origin
|
|
45
|
+
*/
|
|
46
|
+
export declare function getOriginFromUrl(url: string): any;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const a = (r, n) => {
|
|
2
|
+
let e = window.location.search || "";
|
|
3
|
+
if (r && r !== location.href) {
|
|
4
|
+
const s = r.indexOf("?");
|
|
5
|
+
s !== -1 ? e = r.slice(s) : e = "";
|
|
6
|
+
}
|
|
7
|
+
const t = new URLSearchParams(e);
|
|
8
|
+
if (n)
|
|
9
|
+
return t.get(n);
|
|
10
|
+
{
|
|
11
|
+
let s = {};
|
|
12
|
+
for (let [l, c] of t.entries())
|
|
13
|
+
s[l] = c;
|
|
14
|
+
return s;
|
|
15
|
+
}
|
|
16
|
+
}, f = (r, n = {}) => {
|
|
17
|
+
let e = "", t = "";
|
|
18
|
+
const s = Object.keys(n);
|
|
19
|
+
return s && s.length && s.forEach((l, c) => {
|
|
20
|
+
c === s.length - 1 ? t += `${l}=${n[l]}` : t += `${l}=${n[l]}&`;
|
|
21
|
+
}), t ? e = location.origin + r + `?${t}` : e = location.origin + r, e;
|
|
22
|
+
}, h = (r, n) => {
|
|
23
|
+
const e = n || location.href, t = a(e), s = Object.keys(t) || [];
|
|
24
|
+
if (!s || !s.length) return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
|
|
25
|
+
let l = s.filter((i) => !r.includes(i));
|
|
26
|
+
if (!l || !l.length) return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
|
|
27
|
+
let c = "";
|
|
28
|
+
return l.forEach((i, o) => {
|
|
29
|
+
o === s.length - 1 ? c += `${i}=${t[i]}` : c += `${i}=${t[i]}&`;
|
|
30
|
+
}), e.includes("?") ? e.split("?")[0] + `?${c}` : e.split("&")[0] + `?${c}`;
|
|
31
|
+
}, u = (r) => {
|
|
32
|
+
const n = new URLSearchParams(r.split("?")[1]), e = {};
|
|
33
|
+
for (const [t, s] of n)
|
|
34
|
+
e.hasOwnProperty(t) ? Array.isArray(e[t]) ? e[t].push(s) : e[t] = [e[t], s] : e[t] = s;
|
|
35
|
+
return e;
|
|
36
|
+
}, p = (r) => {
|
|
37
|
+
let n = "";
|
|
38
|
+
const e = Object.keys(r);
|
|
39
|
+
return e && e.length && e.forEach((t, s) => {
|
|
40
|
+
s === e.length - 1 ? n += `${t}=${r[t]}` : n += `${t}=${r[t]}&`;
|
|
41
|
+
}), n;
|
|
42
|
+
}, g = (r, n) => {
|
|
43
|
+
let e = r, t = "";
|
|
44
|
+
return r.includes("?") && (e = r.split("?")[0], t = "?" + r.split("?")[1]), Object.values(n).forEach((s) => {
|
|
45
|
+
e += `/${s}`;
|
|
46
|
+
}), e = e.replace(/\/\//g, "/"), t && (e = e + t), e;
|
|
47
|
+
};
|
|
48
|
+
function $(r) {
|
|
49
|
+
const n = /^(https?:\/\/[^/]+)/, e = r.match(n);
|
|
50
|
+
return e && e.length > 1 ? e[1] : null;
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
g as addPathParamsToUrl,
|
|
54
|
+
h as funcUrlDel,
|
|
55
|
+
f as getFullPath,
|
|
56
|
+
$ as getOriginFromUrl,
|
|
57
|
+
a as getUrlParams,
|
|
58
|
+
p as objectToUrlparams,
|
|
59
|
+
u as urlParamsToObject
|
|
60
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 过滤掉叶子节点,返回嵌套数组
|
|
3
|
+
* @param arr 要过滤的树
|
|
4
|
+
* @param children 子节点指定字段名,默认‘children’
|
|
5
|
+
* @returns 返回过滤掉叶子节点的嵌套数组
|
|
6
|
+
*/
|
|
7
|
+
export declare const findNonEmptyChildrenItems: (arr: any[], children?: string) => any[];
|
|
8
|
+
/**
|
|
9
|
+
* 树形数组转扁平数组
|
|
10
|
+
* @param list 要拍平的树
|
|
11
|
+
* @param child 子节点指定字段名,默认‘children’
|
|
12
|
+
* @param deleteChild 是否删除children字段,默认为true
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const flatTree: (list: any[], child?: string, deleteChild?: boolean) => any[];
|
|
16
|
+
/**
|
|
17
|
+
* 根据条件过滤节点
|
|
18
|
+
* @param tree 要过滤的树
|
|
19
|
+
* @param predicate 过滤条件,符合条件的节点保留
|
|
20
|
+
* @param children 子节点指定字段名,默认‘children’
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const filterTreeArray: (tree: any[], predicate: (node: any) => boolean, children?: string) => any;
|
|
24
|
+
/**
|
|
25
|
+
* 树结构查找节点,深度优先
|
|
26
|
+
* @param tree 要过滤的树
|
|
27
|
+
* @param func 过滤条件,符合条件的节点保留(参数为函数,返回值为布尔值)
|
|
28
|
+
* @returns 查找到的节点
|
|
29
|
+
*/
|
|
30
|
+
export declare const treeFind: (tree: any[], func: (node: any) => boolean) => any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const o = (n, t = "children") => {
|
|
2
|
+
let r = [];
|
|
3
|
+
for (let e = 0; e < n.length; e++)
|
|
4
|
+
n[e][t] && n[e][t].length > 0 && (r.push(n[e]), r = r.concat(o(n[e][t])));
|
|
5
|
+
return r;
|
|
6
|
+
}, c = (n, t = "children", r = !0) => Array.isArray(n) && n.length ? n.reduce((e, f) => {
|
|
7
|
+
let l = f[t], u = { ...f };
|
|
8
|
+
return r && delete u[t], l && l.length ? e.concat(u, c(l, t, r)) : e.concat(u);
|
|
9
|
+
}, []) : [], s = (n, t, r = "children") => n.filter((e) => t(e)).map((e) => (e = Object.assign({}, e), e[r] && (e[r] = s(e[r], t)), e)), h = (n, t) => {
|
|
10
|
+
for (const r of n) {
|
|
11
|
+
if (t(r)) return r;
|
|
12
|
+
if (r != null && r.children && r.children.length) {
|
|
13
|
+
const e = h(r.children, t);
|
|
14
|
+
if (e) return e;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
s as filterTreeArray,
|
|
21
|
+
o as findNonEmptyChildrenItems,
|
|
22
|
+
c as flatTree,
|
|
23
|
+
h as treeFind
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const f = (t, r) => {
|
|
2
|
+
if (!t || !r || Object.keys(t).length !== Object.keys(r).length) return !1;
|
|
3
|
+
for (let e in t) {
|
|
4
|
+
if (r[e] === void 0) return !1;
|
|
5
|
+
if (typeof r[e] == "function" || typeof t[e] == "function") throw new Error("type error");
|
|
6
|
+
if (typeof r[e] != typeof t[e]) return !1;
|
|
7
|
+
if (typeof t[e] == "object") return f(t[e], r[e]);
|
|
8
|
+
if (t[e] !== r[e]) return !1;
|
|
9
|
+
}
|
|
10
|
+
return !0;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
f as objEqual
|
|
14
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断一个 URL 路径是否是相对路径或者同域名
|
|
3
|
+
* @param url
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const isRelativeOrSameDomain: (url: string) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* wei自动拼接上showLayout=false参数
|
|
9
|
+
* @param url
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const setShowLayout: (url: string) => string;
|
|
13
|
+
/**
|
|
14
|
+
* url携带token
|
|
15
|
+
* @param url
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const withToken: (url: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getToken as o } from "@das-fed/utils/common-info";
|
|
2
|
+
const n = (t) => !!(!t.startsWith("http") || t.startsWith(location.origin)), i = (t) => {
|
|
3
|
+
if (!t) return "";
|
|
4
|
+
let e = t;
|
|
5
|
+
return n(t) && !t.includes("showLayout=false") && (e = t.indexOf("?") !== -1 ? t + "&showLayout=false" : t + "?showLayout=false"), e;
|
|
6
|
+
}, a = (t) => {
|
|
7
|
+
const e = o();
|
|
8
|
+
return t.includes("?") ? `${t}&token=${e}` : `${t}?token=${e}`;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
n as isRelativeOrSameDomain,
|
|
12
|
+
i as setShowLayout,
|
|
13
|
+
a as withToken
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const _ = (i) => {
|
|
2
|
+
let n = "1366px", e = "528px";
|
|
3
|
+
if (i != null && i.minWidth && (n = i.minWidth), i != null && i.minHeight && (e = i.minHeight), window.__IN_DAS_MICRO_APP) {
|
|
4
|
+
const { left: m = 0, top: t = 0 } = window.__DAS_MICRO_APP_CONTAINER_RECT || {};
|
|
5
|
+
n = `calc(${n} - ${m}px)`, e = `calc(${e} - ${t}px)`;
|
|
6
|
+
}
|
|
7
|
+
document.documentElement.style.minWidth = n, document.documentElement.style.minHeight = e;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
_ as setHtmlMinWH
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设置平台的favIcon
|
|
3
|
+
* @param favIcon 图标
|
|
4
|
+
* @param defaultIcon 默认图标
|
|
5
|
+
*/
|
|
6
|
+
export declare const updateFavIcon: (favIcon: string, defaultIcon?: string) => void;
|
|
7
|
+
/**
|
|
8
|
+
* 设置平台的favIcon,如果localStorage中没有则调用接口获取
|
|
9
|
+
* @param defaultIcon 默认图标
|
|
10
|
+
*/
|
|
11
|
+
export declare const setDasHtmlIcon: (defaultIcon?: string) => any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getFavIcon as s } from "@das-fed/utils/common-info";
|
|
2
|
+
import { pureImageSrc as l } from "@das-fed/utils/pure-image-src";
|
|
3
|
+
import { systemConfiguration as m } from "@das-fed/utils/api-services/modules";
|
|
4
|
+
const c = m.get("/visitor/appearance/with-default", (t) => (t.public = !0, t)), i = (t, o = "./logo.svg") => {
|
|
5
|
+
const r = t || o;
|
|
6
|
+
let e = document.querySelector('link[rel*="icon"]');
|
|
7
|
+
e ? e == null || e.setAttribute("href", r) : (e = document.createElement("link"), e.rel = "icon", e.type = "image/svg+xml", e.href = r, document.getElementsByTagName("head")[0].appendChild(e));
|
|
8
|
+
}, f = async (t = "./logo.svg") => {
|
|
9
|
+
let o = s();
|
|
10
|
+
if (!o) {
|
|
11
|
+
const [r, e] = await c().run();
|
|
12
|
+
if (r) return;
|
|
13
|
+
const { browserLogoImgHost: n = "", browserLogoImg: a = "" } = e;
|
|
14
|
+
o = a ? n + l(a) : "";
|
|
15
|
+
}
|
|
16
|
+
i(o, t);
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
f as setDasHtmlIcon,
|
|
20
|
+
i as updateFavIcon
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
let i;
|
|
2
|
+
const e = { triggerProxySso: "triggerProxySso" }, n = () => {
|
|
3
|
+
i = (o) => {
|
|
4
|
+
var r;
|
|
5
|
+
const { origin: t } = new URL(location.href);
|
|
6
|
+
(r = window.top) == null || r.postMessage(
|
|
7
|
+
{ type: e.triggerProxySso, data: { ...o || {}, redirect_uri: `${t}/` } },
|
|
8
|
+
t
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
}, d = (o) => {
|
|
12
|
+
window.top === window.self && window.addEventListener("message", (t) => {
|
|
13
|
+
const { type: r, data: s } = t.data;
|
|
14
|
+
r === e.triggerProxySso && (o == null || o(s));
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
window.top !== window.self && n();
|
|
18
|
+
export {
|
|
19
|
+
d as addMicroAppProxySsoEvent,
|
|
20
|
+
i as proxySso
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const getQuery: (name: any) => any;
|
|
2
|
+
declare const real_uri: any;
|
|
3
|
+
declare const getTokenParams: any;
|
|
4
|
+
declare const getTokenFromCode: () => unknown;
|
|
5
|
+
declare const getToken: (config: any) => unknown;
|
|
6
|
+
declare const login: (params: any) => any;
|
|
7
|
+
declare const tokenStorage: () => {
|
|
8
|
+
getData: () => {
|
|
9
|
+
accessToken: any;
|
|
10
|
+
accessTokenExpiredAt: any;
|
|
11
|
+
refreshToken: any;
|
|
12
|
+
redirectUri: any;
|
|
13
|
+
};
|
|
14
|
+
save: (data: {
|
|
15
|
+
accessToken?: string | null;
|
|
16
|
+
accessTokenExpiredAt?: string | number | null;
|
|
17
|
+
refreshToken?: string | null;
|
|
18
|
+
redirectUri?: string;
|
|
19
|
+
info?: any;
|
|
20
|
+
}) => void;
|
|
21
|
+
remove: () => void;
|
|
22
|
+
};
|
|
23
|
+
export { getTokenParams, getTokenFromCode, real_uri, getQuery, getToken, tokenStorage, login };
|