@das-fed/utils 7.0.3 → 7.0.4-test.2

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.
@@ -2,7 +2,7 @@ import { getConfig as u } from "@das-fed/utils/config";
2
2
  import { getUrlParams as d } from "@das-fed/utils/common-tools";
3
3
  import { getAccessToken as I } from "@das-fed/utils/token-tools";
4
4
  import { getTokenFromQuery as S, getProjectInfoFromQuery as y } from "@das-fed/utils/common-info/getInfoFromUrl";
5
- const N = I, A = () => {
5
+ const N = I, T = () => {
6
6
  var r;
7
7
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
8
8
  return {
@@ -60,7 +60,7 @@ const N = I, A = () => {
60
60
  leaf: (e == null ? void 0 : e.leaf) ?? !1,
61
61
  optional: (e == null ? void 0 : e.leaf) ?? !0
62
62
  };
63
- }, v = () => {
63
+ }, f = () => {
64
64
  let e = JSON.parse(sessionStorage.getItem("project-message") || "{}");
65
65
  return {
66
66
  id: (e == null ? void 0 : e.id) ?? 0,
@@ -85,7 +85,7 @@ const N = I, A = () => {
85
85
  autoTimezone: (e == null ? void 0 : e.autoTimezone) ?? !1,
86
86
  currency: (e == null ? void 0 : e.currency) ?? {}
87
87
  };
88
- }, f = () => {
88
+ }, v = () => {
89
89
  const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
90
90
  return {
91
91
  applicationCode: (e == null ? void 0 : e.applicationCode) ?? "",
@@ -118,6 +118,7 @@ const N = I, A = () => {
118
118
  currentSubApp: e.currentSubApp ?? {},
119
119
  currentSubAppCode: e.currentSubAppCode ?? "",
120
120
  subAppList: e.subAppList ?? [],
121
+ fixedApps: e.fixedApps ?? [],
121
122
  menuCollapses: e.menuCollapses ?? []
122
123
  };
123
124
  }, U = (e, t = !1) => {
@@ -133,7 +134,7 @@ const N = I, A = () => {
133
134
  s[n.code] = n.menus ?? [];
134
135
  }), s;
135
136
  }
136
- }, E = () => {
137
+ }, x = () => {
137
138
  const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
138
139
  return {
139
140
  currentCode: e.currentCode ?? "",
@@ -141,10 +142,10 @@ const N = I, A = () => {
141
142
  tabMap: e.tabMap ?? {},
142
143
  preTab: e.preTab ?? {}
143
144
  };
144
- }, z = () => {
145
+ }, E = () => {
145
146
  const e = u(), t = sessionStorage.getItem("minioAddress");
146
147
  return t || (e.baseURL ? e.baseURL : location.origin);
147
- }, x = () => ({
148
+ }, z = () => ({
148
149
  instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
149
150
  }), F = () => localStorage.getItem("fav-icon") || "./logo.svg";
150
151
  N() || S();
@@ -152,20 +153,20 @@ var i;
152
153
  (i = C()) != null && i.id || y();
153
154
  export {
154
155
  F as getFavIcon,
155
- f as getHomeInfo,
156
- x as getInstanceInfo,
156
+ v as getHomeInfo,
157
+ z as getInstanceInfo,
157
158
  M as getLanguages,
158
159
  U as getMenus,
159
- z as getMinioAddress,
160
+ E as getMinioAddress,
160
161
  j as getPageAuth,
161
162
  D as getPageAuthBtn,
162
163
  k as getPersonalConfig,
163
164
  J as getPersonalInfo,
164
165
  C as getProjectInfo,
165
- v as getProjectMessage,
166
+ f as getProjectMessage,
166
167
  m as getSubApps,
167
- E as getTabInfo,
168
+ x as getTabInfo,
168
169
  O as getTenantInfo,
169
170
  N as getToken,
170
- A as getUserInfo
171
+ T as getUserInfo
171
172
  };
Binary file
@@ -188,6 +188,8 @@ export interface SubAppsInfo {
188
188
  currentSubAppCode: string
189
189
  /** 当前打开的应用 */
190
190
  subAppList: any[]
191
+ /** 常用应用 */
192
+ fixedApps: any[]
191
193
  /** 当前菜单折叠的应用key集合 */
192
194
  menuCollapses: any[]
193
195
  }
@@ -1,5 +1,5 @@
1
1
  declare const getQuery: (name: any) => any;
2
- declare const real_uri: any;
2
+ declare const real_uri: string;
3
3
  declare const getTokenParams: any;
4
4
  declare const getTokenFromCode: () => unknown;
5
5
  declare const getToken: (config: any) => unknown;
@@ -1683,22 +1683,22 @@ b.getAdapter = Tt.getAdapter;
1683
1683
  b.HttpStatusCode = be;
1684
1684
  b.default = b;
1685
1685
  const {
1686
- Axios: Qr,
1687
- AxiosError: Gr,
1688
- CanceledError: Xr,
1689
- isCancel: Zr,
1690
- CancelToken: Yr,
1691
- VERSION: eo,
1692
- all: to,
1693
- Cancel: no,
1694
- isAxiosError: ro,
1695
- spread: oo,
1696
- toFormData: so,
1697
- AxiosHeaders: io,
1698
- HttpStatusCode: ao,
1699
- formToJSON: co,
1700
- getAdapter: uo,
1701
- mergeConfig: lo
1686
+ Axios: Gr,
1687
+ AxiosError: Xr,
1688
+ CanceledError: Zr,
1689
+ isCancel: Yr,
1690
+ CancelToken: eo,
1691
+ VERSION: to,
1692
+ all: no,
1693
+ Cancel: ro,
1694
+ isAxiosError: oo,
1695
+ spread: so,
1696
+ toFormData: io,
1697
+ AxiosHeaders: ao,
1698
+ HttpStatusCode: co,
1699
+ formToJSON: uo,
1700
+ getAdapter: lo,
1701
+ mergeConfig: fo
1702
1702
  } = b;
1703
1703
  /*! js-cookie v3.0.5 | MIT */
1704
1704
  function Q(e) {
@@ -1923,7 +1923,7 @@ const Y = (e) => new URL(location.href).searchParams.get(e), I = {
1923
1923
  // 清除登录信息
1924
1924
  token: "/api/justauth/oauth-server/v1/visitor/oauth/token"
1925
1925
  // 通过code获取token
1926
- }, { baseURL: Ze, noRedireLogin: Fr = !1 } = Oe(), $ = location.origin + "/home", F = {
1926
+ }, { baseURL: Ze, noRedireLogin: Fr = !1 } = Oe(), Ir = "/home", $ = location.origin + Ir, F = {
1927
1927
  response_type: "code",
1928
1928
  scope: "sever",
1929
1929
  client_id: "sys",
@@ -1946,11 +1946,11 @@ const Y = (e) => new URL(location.href).searchParams.get(e), I = {
1946
1946
  };
1947
1947
  localStorage.getItem("idelTime") && Nt(Number(localStorage.getItem("idelTime")));
1948
1948
  let et = "";
1949
- const Ir = async () => {
1950
- const e = Y("code") || "", t = Y("redirect_url") || "", n = Y("kingdee_token") || "";
1949
+ const Br = async () => {
1950
+ const e = Y("code") || "", t = Y("redirect_url") || "/", n = Y("kingdee_token") || "";
1951
1951
  if (!e) return v();
1952
1952
  if (e === et)
1953
- return Ye(["code", "state", "kingdee_token", "redirect_url"]), t && (window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t))), v();
1953
+ return Ye(["code", "state", "kingdee_token", "redirect_url"]), window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t)), v();
1954
1954
  et = e, Ye(["code", "state", "kingdee_token", "redirect_url"]);
1955
1955
  let r = {};
1956
1956
  const o = {
@@ -1992,7 +1992,7 @@ const Ir = async () => {
1992
1992
  } catch {
1993
1993
  return z({ ...F, redirect_uri: $ });
1994
1994
  }
1995
- }, H = ee(!1), fo = async (e) => {
1995
+ }, H = ee(!1), po = async (e) => {
1996
1996
  if (e.public) return "";
1997
1997
  if (Lt.value) return z({ ...F, redirect_uri: $ });
1998
1998
  if (H.value)
@@ -2013,15 +2013,15 @@ const Ir = async () => {
2013
2013
  let r = v();
2014
2014
  H.value = !0;
2015
2015
  try {
2016
- typeof t == "number" && t > 0 && +/* @__PURE__ */ new Date() + 6e4 > t && (r = await qr(F)), r = await Ir(), H.value = !1;
2016
+ typeof t == "number" && t > 0 && +/* @__PURE__ */ new Date() + 6e4 > t && (r = await Hr(F)), r = await Br(), H.value = !1;
2017
2017
  } catch {
2018
2018
  H.value = !1;
2019
2019
  }
2020
2020
  return r;
2021
- }, Br = () => {
2021
+ }, jr = () => {
2022
2022
  let e = !1;
2023
2023
  return localStorage.getItem("thirdLogouSource") === "zhongshen" && (e = !0), e;
2024
- }, jr = (e) => {
2024
+ }, qr = (e) => {
2025
2025
  if (localStorage.getItem("thirdLogouSource") === "zhongshen") {
2026
2026
  const r = `https://iam.shenyejituan.com:443/idp/profile/OAUTH2/Redirect/GLO?redirctToUrl=${encodeURIComponent(e)}&entityId=AIoT&redirectToLogin=true`;
2027
2027
  localStorage.removeItem("thirdLogouSource"), location.href = r;
@@ -2032,8 +2032,8 @@ const Ir = async () => {
2032
2032
  if (Re) return Re(e);
2033
2033
  e.logout = "true", n && (e.locale = "locale");
2034
2034
  const r = Object.keys(e).filter((s) => s !== "client_secret").map((s) => `${s}=${e[s]}`).join("&"), o = `${t}${I.oauth}?${r}`;
2035
- if (localStorage.removeItem("idelTime"), sessionStorage.clear(), J().remove(), Br())
2036
- jr(o);
2035
+ if (localStorage.removeItem("idelTime"), sessionStorage.clear(), J().remove(), jr())
2036
+ qr(o);
2037
2037
  else {
2038
2038
  try {
2039
2039
  b.create().get(I.logoutCurpage, { baseURL: t });
@@ -2043,7 +2043,7 @@ const Ir = async () => {
2043
2043
  }
2044
2044
  };
2045
2045
  vr(z);
2046
- const qr = async (e) => {
2046
+ const Hr = async (e) => {
2047
2047
  const { baseURL: t } = Oe(), { refreshToken: n } = J().getData();
2048
2048
  try {
2049
2049
  await b.create().get(I.token, { baseURL: t });
@@ -2081,13 +2081,10 @@ const qr = async (e) => {
2081
2081
  refreshToken: ue("refreshToken")
2082
2082
  }),
2083
2083
  save: (e) => {
2084
- Bt(
2085
- e.accessToken || "",
2086
- {
2087
- accessTokenExpiredAt: e.accessTokenExpiredAt,
2088
- refreshToken: e.refreshToken
2089
- }
2090
- ), qt(e);
2084
+ Bt(e.accessToken ?? "", {
2085
+ accessTokenExpiredAt: e.accessTokenExpiredAt,
2086
+ refreshToken: e.refreshToken
2087
+ }), qt(e);
2091
2088
  },
2092
2089
  remove: () => {
2093
2090
  It(), jt();
@@ -2095,8 +2092,8 @@ const qr = async (e) => {
2095
2092
  });
2096
2093
  export {
2097
2094
  Y as getQuery,
2098
- fo as getToken,
2099
- Ir as getTokenFromCode,
2095
+ po as getToken,
2096
+ Br as getTokenFromCode,
2100
2097
  F as getTokenParams,
2101
2098
  z as login,
2102
2099
  $ as real_uri,
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "7.0.3",
3
+ "version": "7.0.4-test.2",
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.0.3",
12
+ "@das-fed/utils": "7.0.4-test.2",
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.0.3",
25
- "@das-fed/web": "7.0.3",
24
+ "@das-fed/cli": "7.0.4-test.2",
25
+ "@das-fed/web": "7.0.4-test.2",
26
26
  "@types/js-cookie": "^3.0.6",
27
27
  "@types/lodash-es": "^4.17.12",
28
28
  "@types/qs": "^6.9.15",
@@ -1,5 +1,9 @@
1
1
  import { Ref } from 'vue';
2
2
 
3
3
  /** 简化组件内使用modelValue时的watch过程 */
4
- declare const useModelValue: (props: any, propKey: string) => Ref;
4
+ declare const useModelValue: (
5
+ /** 组件的props */
6
+ props: any,
7
+ /** 组件props需要使用modelValue的key */
8
+ propKey: string) => Ref;
5
9
  export { useModelValue };