@das-fed/utils 6.4.0-hot.28 → 6.4.0-hot.29

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.
Files changed (81) hide show
  1. package/api-services/i18n/index.d.ts +0 -5
  2. package/api-services/i18n/index.js +6 -7
  3. package/api-services/i18n/index.js.gz +0 -0
  4. package/api-services/index.js +163 -161
  5. package/api-services/index.js.gz +0 -0
  6. package/api-services/modules/app-manage/index.js +6 -4
  7. package/api-services/modules/app-manage/index.js.gz +0 -0
  8. package/api-services/modules/authentication/index.js +6 -4
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/index.js +6 -4
  11. package/api-services/modules/bems/index.js.gz +0 -0
  12. package/api-services/modules/contract/index.js +6 -4
  13. package/api-services/modules/contract/index.js.gz +0 -0
  14. package/api-services/modules/duty-manage/index.js +6 -4
  15. package/api-services/modules/duty-manage/index.js.gz +0 -0
  16. package/api-services/modules/enterpriseright/index.js +6 -4
  17. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  18. package/api-services/modules/file/index.js +51 -48
  19. package/api-services/modules/file/index.js.gz +0 -0
  20. package/api-services/modules/gateway-edge/index.js +6 -4
  21. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  22. package/api-services/modules/index.js +81 -78
  23. package/api-services/modules/index.js.gz +0 -0
  24. package/api-services/modules/iot/index.d.ts +1 -0
  25. package/api-services/modules/iot/index.js +57 -54
  26. package/api-services/modules/iot/index.js.gz +0 -0
  27. package/api-services/modules/justauth/index.js +6 -4
  28. package/api-services/modules/justauth/index.js.gz +0 -0
  29. package/api-services/modules/knowledge/index.js +6 -4
  30. package/api-services/modules/knowledge/index.js.gz +0 -0
  31. package/api-services/modules/link/index.js +6 -4
  32. package/api-services/modules/link/index.js.gz +0 -0
  33. package/api-services/modules/permission/index.js +6 -4
  34. package/api-services/modules/permission/index.js.gz +0 -0
  35. package/api-services/modules/platformManage/index.js +6 -4
  36. package/api-services/modules/platformManage/index.js.gz +0 -0
  37. package/api-services/modules/portal/index.js +6 -4
  38. package/api-services/modules/portal/index.js.gz +0 -0
  39. package/api-services/modules/space-manage/index.js +6 -4
  40. package/api-services/modules/space-manage/index.js.gz +0 -0
  41. package/api-services/modules/super-admin/index.js +6 -4
  42. package/api-services/modules/super-admin/index.js.gz +0 -0
  43. package/api-services/modules/supplier/index.js +6 -4
  44. package/api-services/modules/supplier/index.js.gz +0 -0
  45. package/api-services/modules/supplychain-manage/index.js +6 -4
  46. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  47. package/api-services/modules/systemConfiguration/index.js +6 -4
  48. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  49. package/api-services/modules/tool/index.js +6 -4
  50. package/api-services/modules/tool/index.js.gz +0 -0
  51. package/api-services/src/create-service/index.js +6 -4
  52. package/api-services/src/create-service/index.js.gz +0 -0
  53. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  54. package/common-info/index.d.ts +9 -3
  55. package/common-info/index.js +100 -53
  56. package/common-info/index.js.gz +0 -0
  57. package/common-info/set-personal-info/index.js +16 -12
  58. package/common-info/set-personal-info/index.js.gz +0 -0
  59. package/common-info/type.d.ts +214 -120
  60. package/common-tools/extract-file-name/index.js.gz +0 -0
  61. package/common-tools/get-url-params/index.js.gz +0 -0
  62. package/create-api-service/index.js +6 -4
  63. package/create-api-service/index.js.gz +0 -0
  64. package/create-api-service/sso/index.d.ts +0 -2
  65. package/create-api-service/sso/index.js +255 -252
  66. package/create-api-service/sso/index.js.gz +0 -0
  67. package/curring-http/index.js.gz +0 -0
  68. package/curring-http/type.d.ts +87 -87
  69. package/directive/auth/index.js.gz +0 -0
  70. package/dom-check-in/index.js +2 -2
  71. package/esm-map.json +4 -1
  72. package/hooks/use-get-auth/index.js.gz +0 -0
  73. package/nextTiken/index.js.gz +0 -0
  74. package/package.json +4 -4
  75. package/pinyin-first-character/index.js.gz +0 -0
  76. package/style/index.js.gz +0 -0
  77. package/use-low-code/index.js +3 -3
  78. package/use-low-code/index.js.gz +0 -0
  79. package/use-low-code/style.css +1 -1
  80. package/webSocket-service/index.js.gz +0 -0
  81. package/webSocket-service/type.d.ts +28 -28
@@ -3087,9 +3087,11 @@ const Ut = Ar(), hn = Ut.sso ?? !0, Ns = Ut.i18n ?? !0, mn = Ut.noRedireLogin ??
3087
3087
  }
3088
3088
  };
3089
3089
  })), i.code) {
3090
- if (n = i.code, Ns) {
3091
- const g = (i == null ? void 0 : i.status) ?? "";
3092
- r = !(i != null && i.data) || !i.data.length ? W(g) : W(g, ...i.data);
3090
+ n = i.code;
3091
+ const g = (e == null ? void 0 : e.i18n) ?? !0;
3092
+ if (Ns && g) {
3093
+ const y = (i == null ? void 0 : i.status) ?? "";
3094
+ r = !(i != null && i.data) || !i.data.length ? W(y) : W(y, ...i.data);
3093
3095
  } else
3094
3096
  r = (i == null ? void 0 : i.msg) ?? "";
3095
3097
  o = i;
@@ -3122,7 +3124,7 @@ const Ut = Ar(), hn = Ut.sso ?? !0, Ns = Ut.i18n ?? !0, mn = Ut.noRedireLogin ??
3122
3124
  const { instanceInfo: l } = Cn();
3123
3125
  l != null && l.instanceId && (s.instance = l.instanceId);
3124
3126
  }
3125
- return r.params = s, r.headers.Timezone = Ot.tz.guess(), r;
3127
+ return r.params = s, r.headers.Timezone = Ot.tz.guess(), r.headers["X-Origin"] = location.origin, r;
3126
3128
  });
3127
3129
  }, $s = "v2", Ws = Is(`/api/tool/${$s}`);
3128
3130
  export {
@@ -3087,9 +3087,11 @@ const Ut = Ar(), hn = Ut.sso ?? !0, Ns = Ut.i18n ?? !0, mn = Ut.noRedireLogin ??
3087
3087
  }
3088
3088
  };
3089
3089
  })), i.code) {
3090
- if (n = i.code, Ns) {
3091
- const g = (i == null ? void 0 : i.status) ?? "";
3092
- r = !(i != null && i.data) || !i.data.length ? W(g) : W(g, ...i.data);
3090
+ n = i.code;
3091
+ const g = (e == null ? void 0 : e.i18n) ?? !0;
3092
+ if (Ns && g) {
3093
+ const y = (i == null ? void 0 : i.status) ?? "";
3094
+ r = !(i != null && i.data) || !i.data.length ? W(y) : W(y, ...i.data);
3093
3095
  } else
3094
3096
  r = (i == null ? void 0 : i.msg) ?? "";
3095
3097
  o = i;
@@ -3122,7 +3124,7 @@ const Ut = Ar(), hn = Ut.sso ?? !0, Ns = Ut.i18n ?? !0, mn = Ut.noRedireLogin ??
3122
3124
  const { instanceInfo: l } = Fn();
3123
3125
  l != null && l.instanceId && (s.instance = l.instanceId);
3124
3126
  }
3125
- return r.params = s, r.headers.Timezone = Ot.tz.guess(), (e == null ? void 0 : e(r)) || r;
3127
+ return r.params = s, r.headers.Timezone = Ot.tz.guess(), r.headers["X-Origin"] = location.origin, (e == null ? void 0 : e(r)) || r;
3126
3128
  });
3127
3129
  };
3128
3130
  export {
@@ -1,4 +1,4 @@
1
- import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, ProjectInfo, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
1
+ import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, PersonalConfigInfo, ProjectInfo, ProjectMessage, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
2
2
 
3
3
  /** 获取token */
4
4
  export declare const getToken: any;
@@ -13,15 +13,21 @@ export declare const getTenantInfo: () => TenantInfo;
13
13
  * @returns 项目信息
14
14
  */
15
15
  export declare const getProjectInfo: () => ProjectInfo;
16
+ /**
17
+ * 获取项目信息
18
+ * @returns 项目信息
19
+ */
20
+ export declare const getProjectMessage: () => ProjectMessage;
16
21
  /** 获取首页信息 */
17
22
  export declare const getHomeInfo: () => HomeInfo;
23
+ export declare const getPersonalConfig: () => PersonalConfigInfo;
18
24
  /**
19
25
  * 可用于判断菜单或者按钮权限
20
26
  * @param menuCode 菜单编码
21
27
  * @param applicationCode 应用编码
22
- * @returns undefined(无菜单权限);空数组(无按钮权限)
28
+ * @returns 无菜单权限返回undefined,有菜单权限但是没有任何按钮权限返回空数组
23
29
  */
24
- export declare const getPageAuth: (menuCode?: string, applicationCode?: string) => any;
30
+ export declare const getPageAuth: (menuCode?: string, applicationCode?: string) => undefined | any[];
25
31
  /**
26
32
  * 获取指定菜单的按钮权限数据
27
33
  * @param menuCode 菜单编码
@@ -1,41 +1,52 @@
1
- import { getConfig as p } from "@das-fed/utils/config";
2
- import { getUrlParams as g } from "@das-fed/utils/common-tools";
3
- import { getAccessToken as m } from "@das-fed/utils/token-tools";
4
- import { getTokenFromQuery as f, getProjectInfoFromQuery as d } from "@das-fed/utils/common-info/getInfoFromUrl";
5
- const S = m, J = () => {
6
- var n;
1
+ import { getConfig as u } from "@das-fed/utils/config";
2
+ import { getUrlParams as d } from "@das-fed/utils/common-tools";
3
+ import { getAccessToken as I } from "@das-fed/utils/token-tools";
4
+ import { getTokenFromQuery as S, getProjectInfoFromQuery as y } from "@das-fed/utils/common-info/getInfoFromUrl";
5
+ const N = I, A = () => {
6
+ var r;
7
7
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
8
8
  return {
9
9
  id: e.id ?? "",
10
10
  name: e.userName ?? "",
11
11
  flag: e.flag ?? null,
12
- tenantId: ((n = e == null ? void 0 : e.tenant) == null ? void 0 : n.id) ?? ""
12
+ tenantId: ((r = e == null ? void 0 : e.tenant) == null ? void 0 : r.id) ?? ""
13
13
  };
14
- }, O = () => {
14
+ }, J = () => {
15
15
  let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
16
- const t = p();
16
+ const t = u();
17
17
  return JSON.stringify(e) === "{}" && t.personalInfo && (e = t.personalInfo), {
18
18
  id: e.id ?? "",
19
19
  name: e.name ?? "",
20
- phone: e.phone ?? "",
21
20
  userName: e.userName ?? "",
21
+ phone: e.phone ?? "",
22
22
  email: e.email ?? "",
23
23
  headPicture: e.headPicture ?? ""
24
24
  };
25
- }, P = () => {
25
+ }, O = () => {
26
26
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
27
27
  return {
28
28
  userId: e.id ?? "",
29
29
  userName: e.userName ?? "",
30
30
  name: e.name ?? "",
31
31
  areaCode: e.areaCode ?? "",
32
+ region: e.region ?? "",
32
33
  phone: e.phone ?? "",
34
+ email: e.email ?? "",
33
35
  flag: e.flag ?? null,
34
- tenant: e.tenant ?? {}
36
+ tenant: e.tenant ?? {},
37
+ headPicture: e.headPicture ?? "",
38
+ nickName: e.nickName ?? "",
39
+ gender: e.gender ?? null,
40
+ status: e.status ?? null,
41
+ statusName: e.statusName ?? null,
42
+ tags: e.tags ?? [],
43
+ type: e.type ?? null,
44
+ address: e.address ?? "",
45
+ description: e.description ?? ""
35
46
  };
36
- }, b = () => {
47
+ }, C = () => {
37
48
  let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
38
- const t = p();
49
+ const t = u();
39
50
  return JSON.stringify(e) === "{}" && t.projectInfo && (e = t.projectInfo), {
40
51
  id: (e == null ? void 0 : e.id) ?? 0,
41
52
  code: (e == null ? void 0 : e.code) ?? 0,
@@ -49,7 +60,32 @@ const S = m, J = () => {
49
60
  leaf: (e == null ? void 0 : e.leaf) ?? !1,
50
61
  optional: (e == null ? void 0 : e.leaf) ?? !0
51
62
  };
52
- }, T = () => {
63
+ }, M = () => {
64
+ let e = JSON.parse(sessionStorage.getItem("project-message") || "{}");
65
+ return {
66
+ id: (e == null ? void 0 : e.id) ?? 0,
67
+ projectName: (e == null ? void 0 : e.projectName) ?? "",
68
+ provinceCode: (e == null ? void 0 : e.provinceCode) ?? "",
69
+ cityCode: (e == null ? void 0 : e.cityCode) ?? "",
70
+ areaCode: (e == null ? void 0 : e.areaCode) ?? "",
71
+ address: (e == null ? void 0 : e.address) ?? "",
72
+ projectDesc: (e == null ? void 0 : e.projectDesc) ?? "",
73
+ logoPath: (e == null ? void 0 : e.logoPath) ?? "",
74
+ projectType: (e == null ? void 0 : e.projectType) ?? "",
75
+ projectTypeCode: (e == null ? void 0 : e.projectTypeCode) ?? "",
76
+ longitude: (e == null ? void 0 : e.longitude) ?? "",
77
+ latitude: (e == null ? void 0 : e.latitude) ?? "",
78
+ projectStartDate: (e == null ? void 0 : e.projectStartDate) ?? "",
79
+ projectExpiryDate: (e == null ? void 0 : e.projectExpiryDate) ?? "",
80
+ projectCode: (e == null ? void 0 : e.projectCode) ?? "",
81
+ mapConfiguration: (e == null ? void 0 : e.mapConfiguration) ?? !1,
82
+ cityName: (e == null ? void 0 : e.cityName) ?? "",
83
+ cityNamePinyin: (e == null ? void 0 : e.cityNamePinyin) ?? "",
84
+ timezone: (e == null ? void 0 : e.timezone) ?? "",
85
+ autoTimezone: (e == null ? void 0 : e.autoTimezone) ?? !1,
86
+ currency: (e == null ? void 0 : e.currency) ?? {}
87
+ };
88
+ }, v = () => {
53
89
  const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
54
90
  return {
55
91
  applicationCode: (e == null ? void 0 : e.applicationCode) ?? "",
@@ -57,16 +93,25 @@ const S = m, J = () => {
57
93
  enable: (e == null ? void 0 : e.enable) ?? !1,
58
94
  originalCode: (e == null ? void 0 : e.originalCode) ?? "",
59
95
  routeUrl: (e == null ? void 0 : e.routeUrl) ?? "",
96
+ displayPosition: (e == null ? void 0 : e.displayPosition) ?? 1,
60
97
  type: (e == null ? void 0 : e.type) ?? null
61
98
  };
62
- }, h = (e, t) => {
63
- const n = "permission-btn", s = I(), a = g(location.href, "app") || "", r = t || a || s.currentSubAppCode;
64
- if (!r) return;
65
- const o = g(location.href, "menu") || "", l = e || o || s.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(n) || "{}");
99
+ }, f = () => {
100
+ const e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
101
+ return {
102
+ style: (e == null ? void 0 : e.style) ?? "",
103
+ skinStyle: (e == null ? void 0 : e.skinStyle) ?? ""
104
+ };
105
+ }, j = (e, t) => {
106
+ var g;
107
+ const r = "permission-btn", a = m(), o = d(location.href, "app") || "", s = t || o || a.currentSubAppCode;
108
+ if (!s) return;
109
+ const n = d(location.href, "menu") || "", l = e || n || a.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(r) || "{}");
66
110
  if (!c || JSON.stringify(c) === "{}") return;
67
- const u = c[r][l];
68
- return u && u.length ? u : c[r]["origin-auth"] ? c[r]["origin-auth"][l] ?? [] : [];
69
- }, M = (e, t) => h(e, t) ?? [], I = () => {
111
+ const p = (g = c[s]) == null ? void 0 : g[l];
112
+ if (p)
113
+ return p.length ? p : c[s]["origin-auth"] ? c[s]["origin-auth"][l] ?? [] : [];
114
+ }, k = (e, t) => j(e, t) ?? [], m = () => {
70
115
  const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
71
116
  return {
72
117
  appcategorys: e.appcategorys ?? [],
@@ -75,20 +120,20 @@ const S = m, J = () => {
75
120
  subAppList: e.subAppList ?? [],
76
121
  menuCollapses: e.menuCollapses ?? []
77
122
  };
78
- }, j = (e, t = !1) => {
79
- var s, a;
80
- const n = I().subAppList;
123
+ }, D = (e, t = !1) => {
124
+ var a, o;
125
+ const r = m().subAppList;
81
126
  if (e)
82
- return t ? ((s = n == null ? void 0 : n.find((r) => r.code === e)) == null ? void 0 : s.originalMenus) ?? [] : ((a = n == null ? void 0 : n.find((r) => r.code === e)) == null ? void 0 : a.menus) ?? [];
127
+ return t ? ((a = r == null ? void 0 : r.find((s) => s.code === e)) == null ? void 0 : a.originalMenus) ?? [] : ((o = r == null ? void 0 : r.find((s) => s.code === e)) == null ? void 0 : o.menus) ?? [];
83
128
  {
84
- let r = {};
85
- return t ? n == null || n.forEach((o) => {
86
- r[o.code] = o.originalMenus ?? [];
87
- }) : n == null || n.forEach((o) => {
88
- r[o.code] = o.menus ?? [];
89
- }), r;
129
+ let s = {};
130
+ return t ? r == null || r.forEach((n) => {
131
+ s[n.code] = n.originalMenus ?? [];
132
+ }) : r == null || r.forEach((n) => {
133
+ s[n.code] = n.menus ?? [];
134
+ }), s;
90
135
  }
91
- }, v = () => {
136
+ }, U = () => {
92
137
  const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
93
138
  return {
94
139
  currentCode: e.currentCode ?? "",
@@ -96,28 +141,30 @@ const S = m, J = () => {
96
141
  tabMap: e.tabMap ?? {},
97
142
  preTab: e.preTab ?? {}
98
143
  };
99
- }, U = () => {
100
- const e = p(), t = sessionStorage.getItem("minioAddress");
144
+ }, E = () => {
145
+ const e = u(), t = sessionStorage.getItem("minioAddress");
101
146
  return t || (e.baseURL ? e.baseURL : location.origin);
102
- }, k = () => ({
147
+ }, z = () => ({
103
148
  instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
104
- }), E = () => localStorage.getItem("fav-icon") || "./logo.svg";
105
- S() || f();
149
+ }), x = () => localStorage.getItem("fav-icon") || "./logo.svg";
150
+ N() || S();
106
151
  var i;
107
- (i = b()) != null && i.id || d();
152
+ (i = C()) != null && i.id || y();
108
153
  export {
109
- E as getFavIcon,
110
- T as getHomeInfo,
111
- k as getInstanceInfo,
112
- j as getMenus,
113
- U as getMinioAddress,
114
- h as getPageAuth,
115
- M as getPageAuthBtn,
116
- O as getPersonalInfo,
117
- b as getProjectInfo,
118
- I as getSubApps,
119
- v as getTabInfo,
120
- P as getTenantInfo,
121
- S as getToken,
122
- J as getUserInfo
154
+ x as getFavIcon,
155
+ v as getHomeInfo,
156
+ z as getInstanceInfo,
157
+ D as getMenus,
158
+ E as getMinioAddress,
159
+ j as getPageAuth,
160
+ k as getPageAuthBtn,
161
+ f as getPersonalConfig,
162
+ J as getPersonalInfo,
163
+ C as getProjectInfo,
164
+ M as getProjectMessage,
165
+ m as getSubApps,
166
+ U as getTabInfo,
167
+ O as getTenantInfo,
168
+ N as getToken,
169
+ A as getUserInfo
123
170
  };
Binary file
@@ -1697,20 +1697,24 @@ E.getAdapter = Ge.getAdapter;
1697
1697
  E.HttpStatusCode = ae;
1698
1698
  E.default = E;
1699
1699
  const Ln = async (e) => {
1700
- var r;
1700
+ var n;
1701
1701
  const t = {
1702
1702
  personalInfo: "/api/personal-center/personal-server/v1/info"
1703
- }, n = await E.create().get(t.personalInfo, {
1704
- baseURL: Ye().baseURL,
1705
- params: {
1706
- project: (r = Ze()) == null ? void 0 : r.id,
1707
- timestamp: (/* @__PURE__ */ new Date()).getTime()
1708
- },
1709
- headers: {
1710
- Authorization: `Bearer ${e}`
1711
- }
1712
- });
1713
- n != null && n.data && sessionStorage.setItem("userInfo", JSON.stringify(n.data));
1703
+ };
1704
+ try {
1705
+ const r = await E.create().get(t.personalInfo, {
1706
+ baseURL: Ye().baseURL,
1707
+ params: {
1708
+ project: (n = Ze()) == null ? void 0 : n.id,
1709
+ timestamp: (/* @__PURE__ */ new Date()).getTime()
1710
+ },
1711
+ headers: {
1712
+ Authorization: `Bearer ${e}`
1713
+ }
1714
+ });
1715
+ r != null && r.data && sessionStorage.setItem("userInfo", JSON.stringify(r.data));
1716
+ } catch {
1717
+ }
1714
1718
  };
1715
1719
  export {
1716
1720
  Ln as setPersonalInfo