@das-fed/utils 1.0.5 → 1.0.6

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.
@@ -3185,7 +3185,7 @@ const cs = Dr(), bn = cs.sso ?? !0, ls = async (t) => {
3185
3185
  var r;
3186
3186
  return ((r = t.config) == null ? void 0 : r.responseType) === "blob" ? t : t.data ?? t;
3187
3187
  };
3188
- let ae = {};
3188
+ let ae = null;
3189
3189
  const fs = async (t, e) => {
3190
3190
  var u, c, d, l, h;
3191
3191
  ae || (ae = st, self !== top ? ae = ((u = window.top) == null ? void 0 : u.$__DasMessageForApi) || st : window.$__DasMessageForApi = st);
@@ -5,9 +5,9 @@ import { getUrlToken as m, getProjectInfoFromQuery as S } from "@das-fed/utils/c
5
5
  /*! js-cookie v3.0.5 | MIT */
6
6
  function g(e) {
7
7
  for (var n = 1; n < arguments.length; n++) {
8
- var t = arguments[n];
9
- for (var s in t)
10
- e[s] = t[s];
8
+ var r = arguments[n];
9
+ for (var s in r)
10
+ e[s] = r[s];
11
11
  }
12
12
  return e;
13
13
  }
@@ -23,35 +23,35 @@ var b = {
23
23
  }
24
24
  };
25
25
  function I(e, n) {
26
- function t(o, a, r) {
26
+ function r(o, a, t) {
27
27
  if (!(typeof document > "u")) {
28
- r = g({}, n, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
28
+ t = g({}, n, t), typeof t.expires == "number" && (t.expires = new Date(Date.now() + t.expires * 864e5)), t.expires && (t.expires = t.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
29
29
  var i = "";
30
- for (var c in r)
31
- r[c] && (i += "; " + c, r[c] !== !0 && (i += "=" + r[c].split(";")[0]));
30
+ for (var c in t)
31
+ t[c] && (i += "; " + c, t[c] !== !0 && (i += "=" + t[c].split(";")[0]));
32
32
  return document.cookie = o + "=" + e.write(a, o) + i;
33
33
  }
34
34
  }
35
35
  function s(o) {
36
36
  if (!(typeof document > "u" || arguments.length && !o)) {
37
- for (var a = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < a.length; i++) {
37
+ for (var a = document.cookie ? document.cookie.split("; ") : [], t = {}, i = 0; i < a.length; i++) {
38
38
  var c = a[i].split("="), p = c.slice(1).join("=");
39
39
  try {
40
40
  var u = decodeURIComponent(c[0]);
41
- if (r[u] = e.read(p, u), o === u)
41
+ if (t[u] = e.read(p, u), o === u)
42
42
  break;
43
43
  } catch {
44
44
  }
45
45
  }
46
- return o ? r[o] : r;
46
+ return o ? t[o] : t;
47
47
  }
48
48
  }
49
49
  return Object.create(
50
50
  {
51
- set: t,
51
+ set: r,
52
52
  get: s,
53
53
  remove: function(o, a) {
54
- t(
54
+ r(
55
55
  o,
56
56
  "",
57
57
  g({}, a, {
@@ -73,27 +73,28 @@ function I(e, n) {
73
73
  );
74
74
  }
75
75
  var A = I(b, { path: "/" });
76
- const h = () => A.get("accessToken") ?? "", j = () => {
77
- const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
78
- let t = l().getData().info;
79
- return n || e.userInfo && (t = e.userInfo), {
80
- id: t.sub ?? "",
81
- name: t.name ?? "",
82
- flag: t.flag,
83
- tenantId: (t == null ? void 0 : t.tenant) ?? (t == null ? void 0 : t.tenantId) ?? ""
76
+ const h = () => A.get("accessToken") ?? "", w = () => {
77
+ var s;
78
+ let e = (s = l().getData()) == null ? void 0 : s.info;
79
+ const n = f();
80
+ return JSON.stringify(e) === "{}" && n.userInfo && (e = n.userInfo), {
81
+ id: e.sub ?? "",
82
+ name: e.name ?? "",
83
+ flag: e.flag,
84
+ tenantId: (e == null ? void 0 : e.tenant) ?? (e == null ? void 0 : e.tenantId) ?? ""
84
85
  };
85
- }, y = () => {
86
- const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
87
- let t = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
88
- return n || e.personalInfo && (t = e.personalInfo), {
89
- id: t.id ?? "",
90
- name: t.name ?? "",
91
- phone: t.phone ?? "",
92
- userName: t.userName ?? "",
93
- email: t.email ?? "",
94
- headPicture: t.headPicture ?? ""
86
+ }, J = () => {
87
+ let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
88
+ const n = f();
89
+ return JSON.stringify(e) === "{}" && n.personalInfo && (e = n.personalInfo), {
90
+ id: e.id ?? "",
91
+ name: e.name ?? "",
92
+ phone: e.phone ?? "",
93
+ userName: e.userName ?? "",
94
+ email: e.email ?? "",
95
+ headPicture: e.headPicture ?? ""
95
96
  };
96
- }, R = () => {
97
+ }, j = () => {
97
98
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
98
99
  return {
99
100
  userId: e.id ?? "",
@@ -104,25 +105,25 @@ const h = () => A.get("accessToken") ?? "", j = () => {
104
105
  flag: e.flag ?? null,
105
106
  tenant: e.tenant ?? {}
106
107
  };
107
- }, U = () => {
108
- const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
109
- let t = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
110
- return n || e.projectInfo && (t = e.projectInfo), {
111
- id: (t == null ? void 0 : t.id) ?? "",
112
- parentId: (t == null ? void 0 : t.parentId) ?? "",
113
- name: (t == null ? void 0 : t.name) ?? "",
114
- tenantId: (t == null ? void 0 : t.tenant) ?? ""
108
+ }, R = () => {
109
+ let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
110
+ const n = f();
111
+ return JSON.stringify(e) === "{}" && n.projectInfo && (e = n.projectInfo), {
112
+ id: (e == null ? void 0 : e.id) ?? "",
113
+ parentId: (e == null ? void 0 : e.parentId) ?? "",
114
+ name: (e == null ? void 0 : e.name) ?? "",
115
+ tenantId: (e == null ? void 0 : e.tenant) ?? ""
115
116
  };
116
117
  }, _ = (e, n) => {
117
- const t = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", r = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
118
- if (!r)
118
+ const r = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", t = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
119
+ if (!t)
119
120
  return;
120
- const i = d(location.href, "menu") || "", c = e || i || (window.__IN_MICRO_APP__ ? o.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), p = JSON.parse(sessionStorage.getItem(t) || "{}");
121
+ const i = d(location.href, "menu") || "", c = e || i || (window.__IN_MICRO_APP__ ? o.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), p = JSON.parse(sessionStorage.getItem(r) || "{}");
121
122
  if (!p || JSON.stringify(p) === "{}")
122
123
  return;
123
- const u = p[r][c];
124
- return u && u.length ? u : p[r]["origin-auth"] ? p[r]["origin-auth"][c] ?? [] : [];
125
- }, M = (e, n) => _(e, n) ?? [], v = () => {
124
+ const u = p[t][c];
125
+ return u && u.length ? u : p[t]["origin-auth"] ? p[t]["origin-auth"][c] ?? [] : [];
126
+ }, U = (e, n) => _(e, n) ?? [], v = () => {
126
127
  var s;
127
128
  if (!window.__IN_MICRO_APP__)
128
129
  return {};
@@ -134,25 +135,25 @@ const h = () => A.get("accessToken") ?? "", j = () => {
134
135
  flatSubAppList: n,
135
136
  subAppList: e.subAppList ?? []
136
137
  };
137
- }, T = (e) => {
138
+ }, M = (e) => {
138
139
  const n = JSON.parse(sessionStorage.getItem("menus") || "{}");
139
140
  return e ? n[e] ?? [] : n;
140
- }, J = () => {
141
+ }, T = () => {
141
142
  const e = f();
142
143
  let n = {};
143
144
  if (window.__IN_MICRO_APP__) {
144
- const t = JSON.parse(sessionStorage.getItem("tabs") || "{}");
145
+ const r = JSON.parse(sessionStorage.getItem("tabs") || "{}");
145
146
  n = {
146
- activeKey: t.activeKey ?? "",
147
- currentTab: t.currentTab ?? {},
148
- tabMap: t.tabMap ?? {}
147
+ activeKey: r.activeKey ?? "",
148
+ currentTab: r.currentTab ?? {},
149
+ tabMap: r.tabMap ?? {}
149
150
  };
150
151
  } else {
151
- const t = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
152
+ const r = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
152
153
  n = {
153
- activeKey: t.activeKey ?? "",
154
- currentTab: t.currentTab ?? {},
155
- tabList: t.tabList ?? []
154
+ activeKey: r.activeKey ?? "",
155
+ currentTab: r.currentTab ?? {},
156
+ tabList: r.tabList ?? []
156
157
  };
157
158
  }
158
159
  return n;
@@ -163,15 +164,15 @@ const h = () => A.get("accessToken") ?? "", j = () => {
163
164
  h() || m();
164
165
  S();
165
166
  export {
166
- T as getMenus,
167
+ M as getMenus,
167
168
  k as getMinioAddress,
168
169
  _ as getPageAuth,
169
- M as getPageAuthBtn,
170
- y as getPersonalInfo,
171
- U as getProjectInfo,
170
+ U as getPageAuthBtn,
171
+ J as getPersonalInfo,
172
+ R as getProjectInfo,
172
173
  v as getSubApps,
173
- J as getTabInfo,
174
- R as getTenantInfo,
174
+ T as getTabInfo,
175
+ j as getTenantInfo,
175
176
  h as getToken,
176
- j as getUserInfo
177
+ w as getUserInfo
177
178
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@antv/x6": "^2.18.1",
12
12
  "@das-fed/ui": "1.1.3",
13
- "@das-fed/utils": "1.0.5",
13
+ "@das-fed/utils": "1.0.6",
14
14
  "@vue/shared": "^3.4.21",
15
15
  "axios": "^1.6.7",
16
16
  "dayjs": "^1.11.10",