leadal-portal-base 0.0.10 → 0.0.12

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.esm.js CHANGED
@@ -1733,43 +1733,37 @@ G.getAdapter = Hr.getAdapter;
1733
1733
  G.HttpStatusCode = Ve;
1734
1734
  G.default = G;
1735
1735
  const {
1736
- Axios: ri,
1737
- AxiosError: ni,
1738
- CanceledError: oi,
1739
- isCancel: ai,
1740
- CancelToken: ii,
1741
- VERSION: si,
1742
- all: xi,
1743
- Cancel: ci,
1744
- isAxiosError: fi,
1745
- spread: li,
1746
- toFormData: ui,
1747
- AxiosHeaders: di,
1748
- HttpStatusCode: hi,
1749
- formToJSON: pi,
1750
- getAdapter: vi,
1751
- mergeConfig: Ei
1736
+ Axios: ti,
1737
+ AxiosError: ri,
1738
+ CanceledError: ni,
1739
+ isCancel: oi,
1740
+ CancelToken: ai,
1741
+ VERSION: ii,
1742
+ all: si,
1743
+ Cancel: xi,
1744
+ isAxiosError: ci,
1745
+ spread: fi,
1746
+ toFormData: li,
1747
+ AxiosHeaders: ui,
1748
+ HttpStatusCode: di,
1749
+ formToJSON: hi,
1750
+ getAdapter: pi,
1751
+ mergeConfig: vi
1752
1752
  } = G;
1753
1753
  function To() {
1754
- return I.request({
1754
+ return j.request({
1755
1755
  url: "/wuji-portal-visual/organ/getUserRole",
1756
1756
  method: "GET"
1757
1757
  });
1758
1758
  }
1759
1759
  function Ro() {
1760
- return I.request({
1760
+ return j.request({
1761
1761
  url: "/wuji-portal-visual/auth/api/currentUser",
1762
1762
  method: "GET"
1763
1763
  });
1764
1764
  }
1765
- function Oo(e) {
1766
- return I.request({
1767
- url: `/wuji-portal-visual/portalServerDomain/getDomain/${e}`,
1768
- method: "GET"
1769
- });
1770
- }
1771
1765
  function Tt(e) {
1772
- return I.request({
1766
+ return j.request({
1773
1767
  url: "/wuji-portal-visual/portalServerDomain/getDomainAll",
1774
1768
  method: "GET",
1775
1769
  params: e
@@ -1778,7 +1772,7 @@ function Tt(e) {
1778
1772
  const P0 = {
1779
1773
  /**
1780
1774
  * @doc
1781
- * @API fnComm
1775
+ * @API utils
1782
1776
  * @desc 获取域名列表信息
1783
1777
  * @return {Promise<Array>} 域名信息数组的Promise对象
1784
1778
  * @example getDomains() => Promise.resolve([{serverCode: 'home', serverDomain: 'home.zhwz.lz', ...}])
@@ -1795,7 +1789,7 @@ const P0 = {
1795
1789
  },
1796
1790
  /**
1797
1791
  * @doc
1798
- * @API fnComm
1792
+ * @API utils
1799
1793
  * @desc 将对象转化为FormData形式参数
1800
1794
  * @param {Object} data - 需要转换的对象
1801
1795
  * @return {FormData} 转换后的FormData对象
@@ -1810,7 +1804,7 @@ const P0 = {
1810
1804
  },
1811
1805
  /**
1812
1806
  * @doc
1813
- * @API fnComm
1807
+ * @API utils
1814
1808
  * @desc IP地址检测函数
1815
1809
  * @param {String} url - 需要检测的字符串
1816
1810
  * @return {Boolean} 是否为IP地址
@@ -1822,7 +1816,7 @@ const P0 = {
1822
1816
  },
1823
1817
  /**
1824
1818
  * @doc
1825
- * @API fnComm
1819
+ * @API utils
1826
1820
  * @desc 从地址栏参数中获取指定参数值
1827
1821
  * @param {String} name - 参数名称
1828
1822
  * @return {String} 参数值
@@ -1838,7 +1832,7 @@ const P0 = {
1838
1832
  },
1839
1833
  /**
1840
1834
  * @doc
1841
- * @API fnComm
1835
+ * @API utils
1842
1836
  * @desc 深度复制对象或数组
1843
1837
  * @param {Object|Array} target - 需要复制的目标
1844
1838
  * @return {Object|Array} 复制后的新对象或数组
@@ -1855,7 +1849,7 @@ const P0 = {
1855
1849
  },
1856
1850
  /**
1857
1851
  * @doc
1858
- * @API fnComm
1852
+ * @API utils
1859
1853
  * @desc 将数字转换为中文数字表示
1860
1854
  * @param {Number} num - 需要转换的数字
1861
1855
  * @return {String} 中文数字字符串
@@ -1878,7 +1872,7 @@ const P0 = {
1878
1872
  },
1879
1873
  /**
1880
1874
  * @doc
1881
- * @API fnComm
1875
+ * @API utils
1882
1876
  * @desc 复制文本到剪贴板
1883
1877
  * @param {String} text - 要复制的内容
1884
1878
  * @param {Function} callback - 复制完成后的回调函数
@@ -1891,7 +1885,7 @@ const P0 = {
1891
1885
  },
1892
1886
  /**
1893
1887
  * @doc
1894
- * @API fnComm
1888
+ * @API utils
1895
1889
  * @desc 安全解析JSON,提供默认值
1896
1890
  * @param {String|Object} e - 需要解析的JSON字符串或对象
1897
1891
  * @param {any} defaultVal - 默认值
@@ -1904,7 +1898,7 @@ const P0 = {
1904
1898
  },
1905
1899
  /**
1906
1900
  * @doc
1907
- * @API fnComm
1901
+ * @API utils
1908
1902
  * @desc 将数组转化为键值对形式的对象
1909
1903
  * @param {Array} arr - 包含key和defaultValue的对象数组
1910
1904
  * @return {Object} - 转换后的键值对对象
@@ -1919,7 +1913,7 @@ const P0 = {
1919
1913
  },
1920
1914
  /**
1921
1915
  * @doc
1922
- * @API fnComm
1916
+ * @API utils
1923
1917
  * @desc 用户获取客户端类型,返回字符串
1924
1918
  * @return String qax:奇安信浏览器;ldtC:立达通客户端;ldt:立达通浏览器;portal:门户浏览器;iframe:门户适配浏览器模式
1925
1919
  * @example workspace.getClientType() === 'portal';
@@ -1931,7 +1925,7 @@ const P0 = {
1931
1925
  },
1932
1926
  /**
1933
1927
  * @doc
1934
- * @API fnComm
1928
+ * @API utils
1935
1929
  * @desc 防抖函数
1936
1930
  * @param {String} name - 防抖标识名称
1937
1931
  * @param {Function} fn - 需要防抖的函数
@@ -1947,7 +1941,7 @@ const P0 = {
1947
1941
  },
1948
1942
  /**
1949
1943
  * @doc
1950
- * @API fnComm
1944
+ * @API utils
1951
1945
  * @desc 将base64转为文件流
1952
1946
  * @param {String} data base64格式的图片数据
1953
1947
  * @param {String} fileName 文件名
@@ -1966,7 +1960,7 @@ const P0 = {
1966
1960
  },
1967
1961
  /**
1968
1962
  * @doc
1969
- * @API fnComm
1963
+ * @API utils
1970
1964
  * @desc 本地文件转为base64
1971
1965
  * @param {String} url 文件URL地址
1972
1966
  * @return {Promise<String>} base64格式的图片数据
@@ -1974,12 +1968,13 @@ const P0 = {
1974
1968
  * @warning 需要axios库支持,且URL需支持跨域访问
1975
1969
  * */
1976
1970
  async loadBase64Image(e) {
1971
+ if (!e) return;
1977
1972
  const t = await G.get(e, { responseType: "blob" }), r = new Blob([t.data], { type: "image/png" });
1978
1973
  return await blobToBase64(r);
1979
1974
  },
1980
1975
  /**
1981
1976
  * @doc
1982
- * @API fnComm
1977
+ * @API utils
1983
1978
  * @desc 将Blob对象转为base64
1984
1979
  * @param {Blob} blob Blob对象
1985
1980
  * @return {Promise<String>} base64格式的图片数据
@@ -1987,18 +1982,36 @@ const P0 = {
1987
1982
  * @warning 无
1988
1983
  * */
1989
1984
  blobToBase64(e) {
1990
- return new Promise((t, r) => {
1991
- const n = new FileReader();
1992
- n.onloadend = () => {
1993
- t(n.result);
1994
- }, n.onerror = r, n.readAsDataURL(e);
1995
- });
1985
+ if (e)
1986
+ return new Promise((t, r) => {
1987
+ const n = new FileReader();
1988
+ n.onloadend = () => {
1989
+ t(n.result);
1990
+ }, n.onerror = r, n.readAsDataURL(e);
1991
+ });
1996
1992
  },
1993
+ /**
1994
+ * @doc
1995
+ * @API utils
1996
+ * @desc 根据服务编码获取服务配置信息
1997
+ * @param {String} code - 服务编码
1998
+ * @return {String|undefined} 服务URL地址或undefined
1999
+ * @example utils.getService('user-service') => 'http://user.leadal.com/'
2000
+ * @warning 若本地存储中不存在服务映射,会自动调用setServiceMapToStorage更新
2001
+ * */
1997
2002
  getService(e) {
1998
2003
  if (!e) return;
1999
2004
  const t = window.localStorage.getItem("com.leadal.portal.service.map");
2000
2005
  return t || P0.setServiceMapToStorage(), JSON.parse(t || "{}")[e];
2001
2006
  },
2007
+ /**
2008
+ * @doc
2009
+ * @API utils
2010
+ * @desc 获取所有服务域名信息并设置到本地存储中
2011
+ * @return {Promise<Object>} 服务映射对象的Promise
2012
+ * @example utils.setServiceMapToStorage().then(serviceMap => console.log(serviceMap))
2013
+ * @warning 异常处理:捕获并记录错误,reject时返回空数组
2014
+ * */
2002
2015
  setServiceMapToStorage() {
2003
2016
  return new Promise(async (e, t) => {
2004
2017
  try {
@@ -2016,10 +2029,10 @@ const P0 = {
2016
2029
  }
2017
2030
  };
2018
2031
  var $e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2019
- function Ho(e) {
2032
+ function Oo(e) {
2020
2033
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2021
2034
  }
2022
- function Po(e) {
2035
+ function Ho(e) {
2023
2036
  if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
2024
2037
  var t = e.default;
2025
2038
  if (typeof t == "function") {
@@ -2039,25 +2052,25 @@ function Po(e) {
2039
2052
  }), r;
2040
2053
  }
2041
2054
  var X0 = { exports: {} };
2042
- function qo(e) {
2055
+ function Po(e) {
2043
2056
  throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
2044
2057
  }
2045
2058
  var G0 = { exports: {} };
2046
- const No = {}, Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2059
+ const qo = {}, No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2047
2060
  __proto__: null,
2048
- default: No
2049
- }, Symbol.toStringTag, { value: "Module" })), zo = /* @__PURE__ */ Po(Lo);
2050
- var Uo = G0.exports, Rt;
2051
- function j() {
2061
+ default: qo
2062
+ }, Symbol.toStringTag, { value: "Module" })), Lo = /* @__PURE__ */ Ho(No);
2063
+ var zo = G0.exports, Rt;
2064
+ function I() {
2052
2065
  return Rt || (Rt = 1, (function(e, t) {
2053
2066
  (function(r, n) {
2054
2067
  e.exports = n();
2055
- })(Uo, function() {
2068
+ })(zo, function() {
2056
2069
  var r = r || (function(n, o) {
2057
2070
  var a;
2058
- if (typeof window < "u" && window.crypto && (a = window.crypto), typeof self < "u" && self.crypto && (a = self.crypto), typeof globalThis < "u" && globalThis.crypto && (a = globalThis.crypto), !a && typeof window < "u" && window.msCrypto && (a = window.msCrypto), !a && typeof $e < "u" && $e.crypto && (a = $e.crypto), !a && typeof qo == "function")
2071
+ if (typeof window < "u" && window.crypto && (a = window.crypto), typeof self < "u" && self.crypto && (a = self.crypto), typeof globalThis < "u" && globalThis.crypto && (a = globalThis.crypto), !a && typeof window < "u" && window.msCrypto && (a = window.msCrypto), !a && typeof $e < "u" && $e.crypto && (a = $e.crypto), !a && typeof Po == "function")
2059
2072
  try {
2060
- a = zo;
2073
+ a = Lo;
2061
2074
  } catch {
2062
2075
  }
2063
2076
  var x = function() {
@@ -2548,12 +2561,12 @@ function j() {
2548
2561
  });
2549
2562
  })(G0)), G0.exports;
2550
2563
  }
2551
- var V0 = { exports: {} }, Io = V0.exports, Ot;
2564
+ var V0 = { exports: {} }, Uo = V0.exports, Ot;
2552
2565
  function qe() {
2553
2566
  return Ot || (Ot = 1, (function(e, t) {
2554
2567
  (function(r, n) {
2555
- e.exports = n(j());
2556
- })(Io, function(r) {
2568
+ e.exports = n(I());
2569
+ })(Uo, function(r) {
2557
2570
  return (function(n) {
2558
2571
  var o = r, a = o.lib, x = a.Base, f = a.WordArray, v = o.x64 = {};
2559
2572
  v.Word = x.extend({
@@ -2778,12 +2791,12 @@ function qe() {
2778
2791
  });
2779
2792
  })(V0)), V0.exports;
2780
2793
  }
2781
- var Q0 = { exports: {} }, jo = Q0.exports, Ht;
2782
- function Wo() {
2794
+ var Q0 = { exports: {} }, Io = Q0.exports, Ht;
2795
+ function jo() {
2783
2796
  return Ht || (Ht = 1, (function(e, t) {
2784
2797
  (function(r, n) {
2785
- e.exports = n(j());
2786
- })(jo, function(r) {
2798
+ e.exports = n(I());
2799
+ })(Io, function(r) {
2787
2800
  return (function() {
2788
2801
  if (typeof ArrayBuffer == "function") {
2789
2802
  var n = r, o = n.lib, a = o.WordArray, x = a.init, f = a.init = function(v) {
@@ -2800,12 +2813,12 @@ function Wo() {
2800
2813
  });
2801
2814
  })(Q0)), Q0.exports;
2802
2815
  }
2803
- var Z0 = { exports: {} }, $o = Z0.exports, Pt;
2804
- function Mo() {
2816
+ var Z0 = { exports: {} }, Wo = Z0.exports, Pt;
2817
+ function $o() {
2805
2818
  return Pt || (Pt = 1, (function(e, t) {
2806
2819
  (function(r, n) {
2807
- e.exports = n(j());
2808
- })($o, function(r) {
2820
+ e.exports = n(I());
2821
+ })(Wo, function(r) {
2809
2822
  return (function() {
2810
2823
  var n = r, o = n.lib, a = o.WordArray, x = n.enc;
2811
2824
  x.Utf16 = x.Utf16BE = {
@@ -2894,12 +2907,12 @@ function Mo() {
2894
2907
  });
2895
2908
  })(Z0)), Z0.exports;
2896
2909
  }
2897
- var J0 = { exports: {} }, Ko = J0.exports, qt;
2910
+ var J0 = { exports: {} }, Mo = J0.exports, qt;
2898
2911
  function B0() {
2899
2912
  return qt || (qt = 1, (function(e, t) {
2900
2913
  (function(r, n) {
2901
- e.exports = n(j());
2902
- })(Ko, function(r) {
2914
+ e.exports = n(I());
2915
+ })(Mo, function(r) {
2903
2916
  return (function() {
2904
2917
  var n = r, o = n.lib, a = o.WordArray, x = n.enc;
2905
2918
  x.Base64 = {
@@ -2969,12 +2982,12 @@ function B0() {
2969
2982
  });
2970
2983
  })(J0)), J0.exports;
2971
2984
  }
2972
- var Y0 = { exports: {} }, Xo = Y0.exports, Nt;
2973
- function Go() {
2985
+ var Y0 = { exports: {} }, Ko = Y0.exports, Nt;
2986
+ function Xo() {
2974
2987
  return Nt || (Nt = 1, (function(e, t) {
2975
2988
  (function(r, n) {
2976
- e.exports = n(j());
2977
- })(Xo, function(r) {
2989
+ e.exports = n(I());
2990
+ })(Ko, function(r) {
2978
2991
  return (function() {
2979
2992
  var n = r, o = n.lib, a = o.WordArray, x = n.enc;
2980
2993
  x.Base64url = {
@@ -3051,12 +3064,12 @@ function Go() {
3051
3064
  });
3052
3065
  })(Y0)), Y0.exports;
3053
3066
  }
3054
- var ee = { exports: {} }, Vo = ee.exports, Lt;
3067
+ var ee = { exports: {} }, Go = ee.exports, Lt;
3055
3068
  function C0() {
3056
3069
  return Lt || (Lt = 1, (function(e, t) {
3057
3070
  (function(r, n) {
3058
- e.exports = n(j());
3059
- })(Vo, function(r) {
3071
+ e.exports = n(I());
3072
+ })(Go, function(r) {
3060
3073
  return (function(n) {
3061
3074
  var o = r, a = o.lib, x = a.WordArray, f = a.Hasher, v = o.algo, i = [];
3062
3075
  (function() {
@@ -3117,12 +3130,12 @@ function C0() {
3117
3130
  });
3118
3131
  })(ee)), ee.exports;
3119
3132
  }
3120
- var te = { exports: {} }, Qo = te.exports, zt;
3133
+ var te = { exports: {} }, Vo = te.exports, zt;
3121
3134
  function Lr() {
3122
3135
  return zt || (zt = 1, (function(e, t) {
3123
3136
  (function(r, n) {
3124
- e.exports = n(j());
3125
- })(Qo, function(r) {
3137
+ e.exports = n(I());
3138
+ })(Vo, function(r) {
3126
3139
  return (function() {
3127
3140
  var n = r, o = n.lib, a = o.WordArray, x = o.Hasher, f = n.algo, v = [], i = f.SHA1 = x.extend({
3128
3141
  _doReset: function() {
@@ -3161,12 +3174,12 @@ function Lr() {
3161
3174
  });
3162
3175
  })(te)), te.exports;
3163
3176
  }
3164
- var re = { exports: {} }, Zo = re.exports, Ut;
3177
+ var re = { exports: {} }, Qo = re.exports, Ut;
3165
3178
  function et() {
3166
3179
  return Ut || (Ut = 1, (function(e, t) {
3167
3180
  (function(r, n) {
3168
- e.exports = n(j());
3169
- })(Zo, function(r) {
3181
+ e.exports = n(I());
3182
+ })(Qo, function(r) {
3170
3183
  return (function(n) {
3171
3184
  var o = r, a = o.lib, x = a.WordArray, f = a.Hasher, v = o.algo, i = [], s = [];
3172
3185
  (function() {
@@ -3213,12 +3226,12 @@ function et() {
3213
3226
  });
3214
3227
  })(re)), re.exports;
3215
3228
  }
3216
- var ne = { exports: {} }, Jo = ne.exports, It;
3217
- function Yo() {
3229
+ var ne = { exports: {} }, Zo = ne.exports, It;
3230
+ function Jo() {
3218
3231
  return It || (It = 1, (function(e, t) {
3219
3232
  (function(r, n, o) {
3220
- e.exports = n(j(), et());
3221
- })(Jo, function(r) {
3233
+ e.exports = n(I(), et());
3234
+ })(Zo, function(r) {
3222
3235
  return (function() {
3223
3236
  var n = r, o = n.lib, a = o.WordArray, x = n.algo, f = x.SHA256, v = x.SHA224 = f.extend({
3224
3237
  _doReset: function() {
@@ -3243,12 +3256,12 @@ function Yo() {
3243
3256
  });
3244
3257
  })(ne)), ne.exports;
3245
3258
  }
3246
- var oe = { exports: {} }, ea = oe.exports, jt;
3259
+ var oe = { exports: {} }, Yo = oe.exports, jt;
3247
3260
  function zr() {
3248
3261
  return jt || (jt = 1, (function(e, t) {
3249
3262
  (function(r, n, o) {
3250
- e.exports = n(j(), qe());
3251
- })(ea, function(r) {
3263
+ e.exports = n(I(), qe());
3264
+ })(Yo, function(r) {
3252
3265
  return (function() {
3253
3266
  var n = r, o = n.lib, a = o.Hasher, x = n.x64, f = x.Word, v = x.WordArray, i = n.algo;
3254
3267
  function s() {
@@ -3384,12 +3397,12 @@ function zr() {
3384
3397
  });
3385
3398
  })(oe)), oe.exports;
3386
3399
  }
3387
- var ae = { exports: {} }, ta = ae.exports, Wt;
3388
- function ra() {
3400
+ var ae = { exports: {} }, ea = ae.exports, Wt;
3401
+ function ta() {
3389
3402
  return Wt || (Wt = 1, (function(e, t) {
3390
3403
  (function(r, n, o) {
3391
- e.exports = n(j(), qe(), zr());
3392
- })(ta, function(r) {
3404
+ e.exports = n(I(), qe(), zr());
3405
+ })(ea, function(r) {
3393
3406
  return (function() {
3394
3407
  var n = r, o = n.x64, a = o.Word, x = o.WordArray, f = n.algo, v = f.SHA512, i = f.SHA384 = v.extend({
3395
3408
  _doReset: function() {
@@ -3414,12 +3427,12 @@ function ra() {
3414
3427
  });
3415
3428
  })(ae)), ae.exports;
3416
3429
  }
3417
- var ie = { exports: {} }, na = ie.exports, $t;
3418
- function oa() {
3430
+ var ie = { exports: {} }, ra = ie.exports, $t;
3431
+ function na() {
3419
3432
  return $t || ($t = 1, (function(e, t) {
3420
3433
  (function(r, n, o) {
3421
- e.exports = n(j(), qe());
3422
- })(na, function(r) {
3434
+ e.exports = n(I(), qe());
3435
+ })(ra, function(r) {
3423
3436
  return (function(n) {
3424
3437
  var o = r, a = o.lib, x = a.WordArray, f = a.Hasher, v = o.x64, i = v.Word, s = o.algo, B = [], l = [], E = [];
3425
3438
  (function() {
@@ -3524,12 +3537,12 @@ function oa() {
3524
3537
  });
3525
3538
  })(ie)), ie.exports;
3526
3539
  }
3527
- var se = { exports: {} }, aa = se.exports, Mt;
3528
- function ia() {
3540
+ var se = { exports: {} }, oa = se.exports, Mt;
3541
+ function aa() {
3529
3542
  return Mt || (Mt = 1, (function(e, t) {
3530
3543
  (function(r, n) {
3531
- e.exports = n(j());
3532
- })(aa, function(r) {
3544
+ e.exports = n(I());
3545
+ })(oa, function(r) {
3533
3546
  /** @preserve
3534
3547
  (c) 2012 by Cédric Mesnil. All rights reserved.
3535
3548
 
@@ -3917,12 +3930,12 @@ function ia() {
3917
3930
  });
3918
3931
  })(se)), se.exports;
3919
3932
  }
3920
- var xe = { exports: {} }, sa = xe.exports, Kt;
3933
+ var xe = { exports: {} }, ia = xe.exports, Kt;
3921
3934
  function tt() {
3922
3935
  return Kt || (Kt = 1, (function(e, t) {
3923
3936
  (function(r, n) {
3924
- e.exports = n(j());
3925
- })(sa, function(r) {
3937
+ e.exports = n(I());
3938
+ })(ia, function(r) {
3926
3939
  (function() {
3927
3940
  var n = r, o = n.lib, a = o.Base, x = n.enc, f = x.Utf8, v = n.algo;
3928
3941
  v.HMAC = a.extend({
@@ -3995,12 +4008,12 @@ function tt() {
3995
4008
  });
3996
4009
  })(xe)), xe.exports;
3997
4010
  }
3998
- var ce = { exports: {} }, xa = ce.exports, Xt;
3999
- function ca() {
4011
+ var ce = { exports: {} }, sa = ce.exports, Xt;
4012
+ function xa() {
4000
4013
  return Xt || (Xt = 1, (function(e, t) {
4001
4014
  (function(r, n, o) {
4002
- e.exports = n(j(), et(), tt());
4003
- })(xa, function(r) {
4015
+ e.exports = n(I(), et(), tt());
4016
+ })(sa, function(r) {
4004
4017
  return (function() {
4005
4018
  var n = r, o = n.lib, a = o.Base, x = o.WordArray, f = n.algo, v = f.SHA256, i = f.HMAC, s = f.PBKDF2 = a.extend({
4006
4019
  /**
@@ -4062,12 +4075,12 @@ function ca() {
4062
4075
  });
4063
4076
  })(ce)), ce.exports;
4064
4077
  }
4065
- var fe = { exports: {} }, fa = fe.exports, Gt;
4078
+ var fe = { exports: {} }, ca = fe.exports, Gt;
4066
4079
  function h0() {
4067
4080
  return Gt || (Gt = 1, (function(e, t) {
4068
4081
  (function(r, n, o) {
4069
- e.exports = n(j(), Lr(), tt());
4070
- })(fa, function(r) {
4082
+ e.exports = n(I(), Lr(), tt());
4083
+ })(ca, function(r) {
4071
4084
  return (function() {
4072
4085
  var n = r, o = n.lib, a = o.Base, x = o.WordArray, f = n.algo, v = f.MD5, i = f.EvpKDF = a.extend({
4073
4086
  /**
@@ -4125,12 +4138,12 @@ function h0() {
4125
4138
  });
4126
4139
  })(fe)), fe.exports;
4127
4140
  }
4128
- var le = { exports: {} }, la = le.exports, Vt;
4141
+ var le = { exports: {} }, fa = le.exports, Vt;
4129
4142
  function V() {
4130
4143
  return Vt || (Vt = 1, (function(e, t) {
4131
4144
  (function(r, n, o) {
4132
- e.exports = n(j(), h0());
4133
- })(la, function(r) {
4145
+ e.exports = n(I(), h0());
4146
+ })(fa, function(r) {
4134
4147
  r.lib.Cipher || (function(n) {
4135
4148
  var o = r, a = o.lib, x = a.Base, f = a.WordArray, v = a.BufferedBlockAlgorithm, i = o.enc;
4136
4149
  i.Utf8;
@@ -4663,12 +4676,12 @@ function V() {
4663
4676
  });
4664
4677
  })(le)), le.exports;
4665
4678
  }
4666
- var ue = { exports: {} }, ua = ue.exports, Qt;
4667
- function da() {
4679
+ var ue = { exports: {} }, la = ue.exports, Qt;
4680
+ function ua() {
4668
4681
  return Qt || (Qt = 1, (function(e, t) {
4669
4682
  (function(r, n, o) {
4670
- e.exports = n(j(), V());
4671
- })(ua, function(r) {
4683
+ e.exports = n(I(), V());
4684
+ })(la, function(r) {
4672
4685
  return r.mode.CFB = (function() {
4673
4686
  var n = r.lib.BlockCipherMode.extend();
4674
4687
  n.Encryptor = n.extend({
@@ -4693,12 +4706,12 @@ function da() {
4693
4706
  });
4694
4707
  })(ue)), ue.exports;
4695
4708
  }
4696
- var de = { exports: {} }, ha = de.exports, Zt;
4697
- function pa() {
4709
+ var de = { exports: {} }, da = de.exports, Zt;
4710
+ function ha() {
4698
4711
  return Zt || (Zt = 1, (function(e, t) {
4699
4712
  (function(r, n, o) {
4700
- e.exports = n(j(), V());
4701
- })(ha, function(r) {
4713
+ e.exports = n(I(), V());
4714
+ })(da, function(r) {
4702
4715
  return r.mode.CTR = (function() {
4703
4716
  var n = r.lib.BlockCipherMode.extend(), o = n.Encryptor = n.extend({
4704
4717
  processBlock: function(a, x) {
@@ -4715,12 +4728,12 @@ function pa() {
4715
4728
  });
4716
4729
  })(de)), de.exports;
4717
4730
  }
4718
- var he = { exports: {} }, va = he.exports, Jt;
4719
- function Ea() {
4731
+ var he = { exports: {} }, pa = he.exports, Jt;
4732
+ function va() {
4720
4733
  return Jt || (Jt = 1, (function(e, t) {
4721
4734
  (function(r, n, o) {
4722
- e.exports = n(j(), V());
4723
- })(va, function(r) {
4735
+ e.exports = n(I(), V());
4736
+ })(pa, function(r) {
4724
4737
  /** @preserve
4725
4738
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
4726
4739
  * derived from CryptoJS.mode.CTR
@@ -4754,12 +4767,12 @@ function Ea() {
4754
4767
  });
4755
4768
  })(he)), he.exports;
4756
4769
  }
4757
- var pe = { exports: {} }, Ba = pe.exports, Yt;
4758
- function Ca() {
4770
+ var pe = { exports: {} }, Ea = pe.exports, Yt;
4771
+ function Ba() {
4759
4772
  return Yt || (Yt = 1, (function(e, t) {
4760
4773
  (function(r, n, o) {
4761
- e.exports = n(j(), V());
4762
- })(Ba, function(r) {
4774
+ e.exports = n(I(), V());
4775
+ })(Ea, function(r) {
4763
4776
  return r.mode.OFB = (function() {
4764
4777
  var n = r.lib.BlockCipherMode.extend(), o = n.Encryptor = n.extend({
4765
4778
  processBlock: function(a, x) {
@@ -4774,12 +4787,12 @@ function Ca() {
4774
4787
  });
4775
4788
  })(pe)), pe.exports;
4776
4789
  }
4777
- var ve = { exports: {} }, Aa = ve.exports, er;
4778
- function ma() {
4790
+ var ve = { exports: {} }, Ca = ve.exports, er;
4791
+ function Aa() {
4779
4792
  return er || (er = 1, (function(e, t) {
4780
4793
  (function(r, n, o) {
4781
- e.exports = n(j(), V());
4782
- })(Aa, function(r) {
4794
+ e.exports = n(I(), V());
4795
+ })(Ca, function(r) {
4783
4796
  return r.mode.ECB = (function() {
4784
4797
  var n = r.lib.BlockCipherMode.extend();
4785
4798
  return n.Encryptor = n.extend({
@@ -4795,12 +4808,12 @@ function ma() {
4795
4808
  });
4796
4809
  })(ve)), ve.exports;
4797
4810
  }
4798
- var Ee = { exports: {} }, Fa = Ee.exports, tr;
4799
- function ga() {
4811
+ var Ee = { exports: {} }, ma = Ee.exports, tr;
4812
+ function Fa() {
4800
4813
  return tr || (tr = 1, (function(e, t) {
4801
4814
  (function(r, n, o) {
4802
- e.exports = n(j(), V());
4803
- })(Fa, function(r) {
4815
+ e.exports = n(I(), V());
4816
+ })(ma, function(r) {
4804
4817
  return r.pad.AnsiX923 = {
4805
4818
  pad: function(n, o) {
4806
4819
  var a = n.sigBytes, x = o * 4, f = x - a % x, v = a + f - 1;
@@ -4814,12 +4827,12 @@ function ga() {
4814
4827
  });
4815
4828
  })(Ee)), Ee.exports;
4816
4829
  }
4817
- var Be = { exports: {} }, ya = Be.exports, rr;
4818
- function ba() {
4830
+ var Be = { exports: {} }, ga = Be.exports, rr;
4831
+ function ya() {
4819
4832
  return rr || (rr = 1, (function(e, t) {
4820
4833
  (function(r, n, o) {
4821
- e.exports = n(j(), V());
4822
- })(ya, function(r) {
4834
+ e.exports = n(I(), V());
4835
+ })(ga, function(r) {
4823
4836
  return r.pad.Iso10126 = {
4824
4837
  pad: function(n, o) {
4825
4838
  var a = o * 4, x = a - n.sigBytes % a;
@@ -4833,12 +4846,12 @@ function ba() {
4833
4846
  });
4834
4847
  })(Be)), Be.exports;
4835
4848
  }
4836
- var Ce = { exports: {} }, Da = Ce.exports, nr;
4837
- function wa() {
4849
+ var Ce = { exports: {} }, ba = Ce.exports, nr;
4850
+ function Da() {
4838
4851
  return nr || (nr = 1, (function(e, t) {
4839
4852
  (function(r, n, o) {
4840
- e.exports = n(j(), V());
4841
- })(Da, function(r) {
4853
+ e.exports = n(I(), V());
4854
+ })(ba, function(r) {
4842
4855
  return r.pad.Iso97971 = {
4843
4856
  pad: function(n, o) {
4844
4857
  n.concat(r.lib.WordArray.create([2147483648], 1)), r.pad.ZeroPadding.pad(n, o);
@@ -4850,12 +4863,12 @@ function wa() {
4850
4863
  });
4851
4864
  })(Ce)), Ce.exports;
4852
4865
  }
4853
- var Ae = { exports: {} }, _a = Ae.exports, or;
4854
- function Sa() {
4866
+ var Ae = { exports: {} }, wa = Ae.exports, or;
4867
+ function _a() {
4855
4868
  return or || (or = 1, (function(e, t) {
4856
4869
  (function(r, n, o) {
4857
- e.exports = n(j(), V());
4858
- })(_a, function(r) {
4870
+ e.exports = n(I(), V());
4871
+ })(wa, function(r) {
4859
4872
  return r.pad.ZeroPadding = {
4860
4873
  pad: function(n, o) {
4861
4874
  var a = o * 4;
@@ -4872,12 +4885,12 @@ function Sa() {
4872
4885
  });
4873
4886
  })(Ae)), Ae.exports;
4874
4887
  }
4875
- var me = { exports: {} }, ka = me.exports, ar;
4876
- function Ta() {
4888
+ var me = { exports: {} }, Sa = me.exports, ar;
4889
+ function ka() {
4877
4890
  return ar || (ar = 1, (function(e, t) {
4878
4891
  (function(r, n, o) {
4879
- e.exports = n(j(), V());
4880
- })(ka, function(r) {
4892
+ e.exports = n(I(), V());
4893
+ })(Sa, function(r) {
4881
4894
  return r.pad.NoPadding = {
4882
4895
  pad: function() {
4883
4896
  },
@@ -4887,12 +4900,12 @@ function Ta() {
4887
4900
  });
4888
4901
  })(me)), me.exports;
4889
4902
  }
4890
- var Fe = { exports: {} }, Ra = Fe.exports, ir;
4891
- function Oa() {
4903
+ var Fe = { exports: {} }, Ta = Fe.exports, ir;
4904
+ function Ra() {
4892
4905
  return ir || (ir = 1, (function(e, t) {
4893
4906
  (function(r, n, o) {
4894
- e.exports = n(j(), V());
4895
- })(Ra, function(r) {
4907
+ e.exports = n(I(), V());
4908
+ })(Ta, function(r) {
4896
4909
  return (function(n) {
4897
4910
  var o = r, a = o.lib, x = a.CipherParams, f = o.enc, v = f.Hex, i = o.format;
4898
4911
  i.Hex = {
@@ -4934,12 +4947,12 @@ function Oa() {
4934
4947
  });
4935
4948
  })(Fe)), Fe.exports;
4936
4949
  }
4937
- var ge = { exports: {} }, Ha = ge.exports, sr;
4938
- function Pa() {
4950
+ var ge = { exports: {} }, Oa = ge.exports, sr;
4951
+ function Ha() {
4939
4952
  return sr || (sr = 1, (function(e, t) {
4940
4953
  (function(r, n, o) {
4941
- e.exports = n(j(), B0(), C0(), h0(), V());
4942
- })(Ha, function(r) {
4954
+ e.exports = n(I(), B0(), C0(), h0(), V());
4955
+ })(Oa, function(r) {
4943
4956
  return (function() {
4944
4957
  var n = r, o = n.lib, a = o.BlockCipher, x = n.algo, f = [], v = [], i = [], s = [], B = [], l = [], E = [], c = [], p = [], u = [];
4945
4958
  (function() {
@@ -4994,12 +5007,12 @@ function Pa() {
4994
5007
  });
4995
5008
  })(ge)), ge.exports;
4996
5009
  }
4997
- var ye = { exports: {} }, qa = ye.exports, xr;
4998
- function Na() {
5010
+ var ye = { exports: {} }, Pa = ye.exports, xr;
5011
+ function qa() {
4999
5012
  return xr || (xr = 1, (function(e, t) {
5000
5013
  (function(r, n, o) {
5001
- e.exports = n(j(), B0(), C0(), h0(), V());
5002
- })(qa, function(r) {
5014
+ e.exports = n(I(), B0(), C0(), h0(), V());
5015
+ })(Pa, function(r) {
5003
5016
  return (function() {
5004
5017
  var n = r, o = n.lib, a = o.WordArray, x = o.BlockCipher, f = n.algo, v = [
5005
5018
  57,
@@ -5714,12 +5727,12 @@ function Na() {
5714
5727
  });
5715
5728
  })(ye)), ye.exports;
5716
5729
  }
5717
- var be = { exports: {} }, La = be.exports, cr;
5718
- function za() {
5730
+ var be = { exports: {} }, Na = be.exports, cr;
5731
+ function La() {
5719
5732
  return cr || (cr = 1, (function(e, t) {
5720
5733
  (function(r, n, o) {
5721
- e.exports = n(j(), B0(), C0(), h0(), V());
5722
- })(La, function(r) {
5734
+ e.exports = n(I(), B0(), C0(), h0(), V());
5735
+ })(Na, function(r) {
5723
5736
  return (function() {
5724
5737
  var n = r, o = n.lib, a = o.StreamCipher, x = n.algo, f = x.RC4 = a.extend({
5725
5738
  _doReset: function() {
@@ -5768,12 +5781,12 @@ function za() {
5768
5781
  });
5769
5782
  })(be)), be.exports;
5770
5783
  }
5771
- var De = { exports: {} }, Ua = De.exports, fr;
5772
- function Ia() {
5784
+ var De = { exports: {} }, za = De.exports, fr;
5785
+ function Ua() {
5773
5786
  return fr || (fr = 1, (function(e, t) {
5774
5787
  (function(r, n, o) {
5775
- e.exports = n(j(), B0(), C0(), h0(), V());
5776
- })(Ua, function(r) {
5788
+ e.exports = n(I(), B0(), C0(), h0(), V());
5789
+ })(za, function(r) {
5777
5790
  return (function() {
5778
5791
  var n = r, o = n.lib, a = o.StreamCipher, x = n.algo, f = [], v = [], i = [], s = x.Rabbit = a.extend({
5779
5792
  _doReset: function() {
@@ -5834,12 +5847,12 @@ function Ia() {
5834
5847
  });
5835
5848
  })(De)), De.exports;
5836
5849
  }
5837
- var we = { exports: {} }, ja = we.exports, lr;
5838
- function Wa() {
5850
+ var we = { exports: {} }, Ia = we.exports, lr;
5851
+ function ja() {
5839
5852
  return lr || (lr = 1, (function(e, t) {
5840
5853
  (function(r, n, o) {
5841
- e.exports = n(j(), B0(), C0(), h0(), V());
5842
- })(ja, function(r) {
5854
+ e.exports = n(I(), B0(), C0(), h0(), V());
5855
+ })(Ia, function(r) {
5843
5856
  return (function() {
5844
5857
  var n = r, o = n.lib, a = o.StreamCipher, x = n.algo, f = [], v = [], i = [], s = x.RabbitLegacy = a.extend({
5845
5858
  _doReset: function() {
@@ -5898,12 +5911,12 @@ function Wa() {
5898
5911
  });
5899
5912
  })(we)), we.exports;
5900
5913
  }
5901
- var _e = { exports: {} }, $a = _e.exports, ur;
5902
- function Ma() {
5914
+ var _e = { exports: {} }, Wa = _e.exports, ur;
5915
+ function $a() {
5903
5916
  return ur || (ur = 1, (function(e, t) {
5904
5917
  (function(r, n, o) {
5905
- e.exports = n(j(), B0(), C0(), h0(), V());
5906
- })($a, function(r) {
5918
+ e.exports = n(I(), B0(), C0(), h0(), V());
5919
+ })(Wa, function(r) {
5907
5920
  return (function() {
5908
5921
  var n = r, o = n.lib, a = o.BlockCipher, x = n.algo;
5909
5922
  const f = 16, v = [
@@ -7020,18 +7033,26 @@ function Ma() {
7020
7033
  });
7021
7034
  })(_e)), _e.exports;
7022
7035
  }
7023
- var Ka = X0.exports, dr;
7024
- function Xa() {
7036
+ var Ma = X0.exports, dr;
7037
+ function Ka() {
7025
7038
  return dr || (dr = 1, (function(e, t) {
7026
7039
  (function(r, n, o) {
7027
- e.exports = n(j(), qe(), Wo(), Mo(), B0(), Go(), C0(), Lr(), et(), Yo(), zr(), ra(), oa(), ia(), tt(), ca(), h0(), V(), da(), pa(), Ea(), Ca(), ma(), ga(), ba(), wa(), Sa(), Ta(), Oa(), Pa(), Na(), za(), Ia(), Wa(), Ma());
7028
- })(Ka, function(r) {
7040
+ e.exports = n(I(), qe(), jo(), $o(), B0(), Xo(), C0(), Lr(), et(), Jo(), zr(), ta(), na(), aa(), tt(), xa(), h0(), V(), ua(), ha(), va(), Ba(), Aa(), Fa(), ya(), Da(), _a(), ka(), Ra(), Ha(), qa(), La(), Ua(), ja(), $a());
7041
+ })(Ma, function(r) {
7029
7042
  return r;
7030
7043
  });
7031
7044
  })(X0)), X0.exports;
7032
7045
  }
7033
- var Ga = Xa();
7034
- const J = /* @__PURE__ */ Ho(Ga), Y = {
7046
+ var Xa = Ka();
7047
+ const J = /* @__PURE__ */ Oo(Xa), Y = {
7048
+ /**
7049
+ * @doc
7050
+ * @API utils
7051
+ * @desc 验证指定类型的存储是否可用
7052
+ * @param {String} type - 存储类型,如'localStorage'、'sessionStorage'
7053
+ * @return {Boolean} 存储是否可用
7054
+ * @example utils.storage.validate('localStorage') => true
7055
+ */
7035
7056
  validate(e) {
7036
7057
  try {
7037
7058
  const t = window[e], r = "__storage_test__";
@@ -7040,7 +7061,16 @@ const J = /* @__PURE__ */ Ho(Ga), Y = {
7040
7061
  return !1;
7041
7062
  }
7042
7063
  },
7043
- // 存到本地
7064
+ /**
7065
+ * @doc
7066
+ * @API utils
7067
+ * @desc 存储数据到localStorage,支持加密选项
7068
+ * @param {String} key - 存储键名
7069
+ * @param {any} value - 要存储的值
7070
+ * @param {Boolean} [isEncrypt=false] - 是否需要加密存储
7071
+ * @return {any} 存储后的值(通过get方法获取)
7072
+ * @example utils.storage.set('userInfo', {name: '张三'}, true)
7073
+ */
7044
7074
  set(e, t, r) {
7045
7075
  if (e && t) {
7046
7076
  const n = (o, a) => {
@@ -7059,7 +7089,15 @@ const J = /* @__PURE__ */ Ho(Ga), Y = {
7059
7089
  return n(e, t);
7060
7090
  }
7061
7091
  },
7062
- // 从本地获取
7092
+ /**
7093
+ * @doc
7094
+ * @API utils
7095
+ * @desc 从localStorage获取数据,支持解密选项
7096
+ * @param {String} key - 存储键名
7097
+ * @param {Boolean} [isUnEncrypt=false] - 是否需要解密获取
7098
+ * @return {any} 获取的数据
7099
+ * @example utils.storage.get('userInfo', true) => {name: '张三'}
7100
+ */
7063
7101
  get(e, t) {
7064
7102
  if (!e)
7065
7103
  return;
@@ -7087,12 +7125,30 @@ const J = /* @__PURE__ */ Ho(Ga), Y = {
7087
7125
  }
7088
7126
  return r();
7089
7127
  },
7128
+ /**
7129
+ * @doc
7130
+ * @API utils
7131
+ * @desc 从localStorage移除指定键名的数据
7132
+ * @param {String} key - 要移除的存储键名
7133
+ * @return {undefined} 无返回值
7134
+ * @example utils.storage.remove('userInfo')
7135
+ */
7090
7136
  remove(e) {
7091
7137
  if (Y.validate("localStorage")) {
7092
7138
  const t = localStorage;
7093
7139
  e && t.removeItem(e);
7094
7140
  }
7095
7141
  },
7142
+ /**
7143
+ * @doc
7144
+ * @API utils
7145
+ * @desc 设置cookie,支持加密选项
7146
+ * @param {String} cName - cookie名称
7147
+ * @param {String} value - cookie值
7148
+ * @param {Number} expiredays - 过期天数
7149
+ * @return {undefined} 无返回值
7150
+ * @example utils.storage.setCookie('token', 'abc123', 7)
7151
+ */
7096
7152
  setCookie(e, t, r) {
7097
7153
  const n = /* @__PURE__ */ new Date();
7098
7154
  n.setDate(n.getDate() + r);
@@ -7102,6 +7158,14 @@ const J = /* @__PURE__ */ Ho(Ga), Y = {
7102
7158
  };
7103
7159
  document.cookie = e + "=" + o(t) + (r == null ? "" : ";expires=" + n.toGMTString());
7104
7160
  },
7161
+ /**
7162
+ * @doc
7163
+ * @API utils
7164
+ * @desc 获取cookie值,支持解密
7165
+ * @param {String} cName - cookie名称
7166
+ * @return {String} cookie值
7167
+ * @example utils.storage.getCookie('token') => 'abc123'
7168
+ */
7105
7169
  getCookie(e) {
7106
7170
  const t = (r) => {
7107
7171
  let n;
@@ -7114,6 +7178,13 @@ const J = /* @__PURE__ */ Ho(Ga), Y = {
7114
7178
  }
7115
7179
  return "";
7116
7180
  },
7181
+ /**
7182
+ * @doc
7183
+ * @API utils
7184
+ * @desc 清除所有cookie
7185
+ * @return {undefined} 无返回值
7186
+ * @example utils.storage.clearAllCookie()
7187
+ */
7117
7188
  clearAllCookie() {
7118
7189
  const e = /* @__PURE__ */ new Date();
7119
7190
  e.setTime(e.getTime() - 1e4);
@@ -7121,6 +7192,16 @@ const J = /* @__PURE__ */ Ho(Ga), Y = {
7121
7192
  if (t)
7122
7193
  for (let r = t.length; r--; ) document.cookie = t[r] + "=0; expire=" + e.toGMTString() + "; path=/";
7123
7194
  },
7195
+ /**
7196
+ * @doc
7197
+ * @API utils
7198
+ * @desc 设置简单cookie(不带加密)
7199
+ * @param {String} cName - cookie名称
7200
+ * @param {String} value - cookie值
7201
+ * @param {Number} expiredays - 过期天数
7202
+ * @return {undefined} 无返回值
7203
+ * @example utils.storage.newSetCookie('username', 'admin', 1)
7204
+ */
7124
7205
  newSetCookie(e, t, r) {
7125
7206
  const n = (/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + r);
7126
7207
  document.cookie = e + "=" + t + (r === null ? "" : ";expires=" + n + ";path=/;");
@@ -7204,7 +7285,7 @@ const J = /* @__PURE__ */ Ho(Ga), Y = {
7204
7285
  withCredentials: !0,
7205
7286
  timeout: 1 / 0
7206
7287
  });
7207
- async function Va(e) {
7288
+ async function Ga(e) {
7208
7289
  return new Promise(async (t, r) => {
7209
7290
  e = e.trim(), e.endsWith("/") && (e = e.slice(0, -1)), Ne.defaults.baseURL = e;
7210
7291
  const n = await P0.setServiceMapToStorage();
@@ -7255,15 +7336,15 @@ Ne.interceptors.response.use(
7255
7336
  }), Promise.reject(e);
7256
7337
  }
7257
7338
  );
7258
- const I = { ...P0, storage: Y, request: Ne }, s0 = {
7339
+ const j = { ...P0, storage: Y, request: Ne }, s0 = {
7259
7340
  /**
7260
7341
  * @doc
7261
- * @API token
7342
+ * @API user
7262
7343
  * @desc 从localStorage获取token并验证有效性
7263
7344
  * @param {String} tokenKey - token存储的键名
7264
7345
  * @param {String} time - 时间戳存储的键名
7265
7346
  * @return {Object|null} - 有效的token对象或null
7266
- * @example getlocalStorageToken('userToken', 'tokenTimestamp')
7347
+ * @example user.getlocalStorageToken('userToken', 'tokenTimestamp')
7267
7348
  * */
7268
7349
  getlocalStorageToken(e, t) {
7269
7350
  const r = localStorage.getItem(e), n = localStorage.getItem(t);
@@ -7276,14 +7357,14 @@ const I = { ...P0, storage: Y, request: Ne }, s0 = {
7276
7357
  },
7277
7358
  /**
7278
7359
  * @doc
7279
- * @API token
7360
+ * @API user
7280
7361
  * @desc 处理URL并添加token参数
7281
7362
  * @param {Object} opts - 配置选项
7282
7363
  * @param {String} opts.serverType - token类型:15s、15s-local、leadal
7283
7364
  * @param {String} opts.url - 需要拼接token的地址,支持@token和@15token替换
7284
7365
  * @param {String} opts.id - 应用ID
7285
7366
  * @return {Object} 包含处理后url和token的opts对象
7286
- * @example setUrlToken({id: 'app1', url: 'https://example.com', serverType: '15s'})
7367
+ * @example user.setUrlToken({id: 'app1', url: 'https://example.com', serverType: '15s'})
7287
7368
  * */
7288
7369
  async setUrlToken(e) {
7289
7370
  var r, n;
@@ -7300,13 +7381,13 @@ const I = { ...P0, storage: Y, request: Ne }, s0 = {
7300
7381
  },
7301
7382
  /**
7302
7383
  * @doc
7303
- * @API token
7384
+ * @API user
7304
7385
  * @desc 根据服务器类型获取通用token
7305
7386
  * @param {Object} opts - 配置选项
7306
7387
  * @param {String} opts.serverType - token类型:15s、15s-local、leadal
7307
7388
  * @param {String} opts.id - 应用ID
7308
7389
  * @return {Object} token信息对象
7309
- * @example getCommonToken({id: 'app1', serverType: '15s-local'})
7390
+ * @example user.getCommonToken({id: 'app1', serverType: '15s-local'})
7310
7391
  * */
7311
7392
  async getCommonToken(e) {
7312
7393
  let t = e.id + "_" + (/* @__PURE__ */ new Date()).getTime();
@@ -7314,14 +7395,14 @@ const I = { ...P0, storage: Y, request: Ne }, s0 = {
7314
7395
  },
7315
7396
  /**
7316
7397
  * @doc
7317
- * @API token
7398
+ * @API user
7318
7399
  * @desc 获取token
7319
7400
  * @param {String} clientId - 客户端ID
7320
7401
  * @return {String} token字符串
7321
- * @example getToken('client123')
7402
+ * @example user.getToken('client123')
7322
7403
  * */
7323
7404
  async getToken(e) {
7324
- let t = await Qa("userToken", "tokenTimestamp");
7405
+ let t = await Va("userToken", "tokenTimestamp");
7325
7406
  if (!t) {
7326
7407
  const r = {
7327
7408
  client_secret: (await rt.getUser()).id,
@@ -7330,7 +7411,7 @@ const I = { ...P0, storage: Y, request: Ne }, s0 = {
7330
7411
  };
7331
7412
  e || (r.client_id = r.client_secret + "_" + (/* @__PURE__ */ new Date()).getTime());
7332
7413
  const n = (/* @__PURE__ */ new Date()).getTime();
7333
- t = await I.request({
7414
+ t = await j.request({
7334
7415
  url: "/wuji-portal-visual/auth/api/getToken",
7335
7416
  method: "POST",
7336
7417
  data: r
@@ -7340,16 +7421,16 @@ const I = { ...P0, storage: Y, request: Ne }, s0 = {
7340
7421
  },
7341
7422
  /**
7342
7423
  * @doc
7343
- * @API token
7424
+ * @API user
7344
7425
  * @desc 获取15s token
7345
7426
  * @return {Object} 包含access_token的token对象
7346
- * @example get15sToken()
7427
+ * @example user.get15sToken()
7347
7428
  * */
7348
7429
  async get15sToken() {
7349
7430
  var t;
7350
7431
  let e = await s0.getlocalStorageToken("user15sToken", "token15sTimestamp");
7351
7432
  if (!e) {
7352
- const r = await I.request({
7433
+ const r = await j.request({
7353
7434
  url: "/wuji-portal-visual/auth/api/out-token",
7354
7435
  method: "GET"
7355
7436
  });
@@ -7364,14 +7445,14 @@ const I = { ...P0, storage: Y, request: Ne }, s0 = {
7364
7445
  },
7365
7446
  /**
7366
7447
  * @doc
7367
- * @API token
7448
+ * @API user
7368
7449
  * @desc token登陆(单点)
7369
7450
  * @param {Object} data - 登录参数
7370
7451
  * @return {Promise} 登录请求的Promise对象
7371
- * @example loginBySSO({token: 'xxx'})
7452
+ * @example user.loginBySSO({token: 'xxx'})
7372
7453
  * */
7373
7454
  loginBySSO(e) {
7374
- return I.request({
7455
+ return j.request({
7375
7456
  url: "/wuji-soft-center/auth/api/loginBySSO",
7376
7457
  method: "POST",
7377
7458
  data: e,
@@ -7379,7 +7460,7 @@ const I = { ...P0, storage: Y, request: Ne }, s0 = {
7379
7460
  });
7380
7461
  }
7381
7462
  };
7382
- function Qa(e, t) {
7463
+ function Va(e, t) {
7383
7464
  const r = localStorage.getItem(e), n = localStorage.getItem(t);
7384
7465
  if (r && n) {
7385
7466
  const o = (/* @__PURE__ */ new Date()).getTime(), a = parseInt(n, 10);
@@ -7390,17 +7471,19 @@ function Qa(e, t) {
7390
7471
  const rt = {
7391
7472
  /**
7392
7473
  * @doc
7393
- * @API info
7394
- * @desc 存储打开记录,统计app打开次数
7395
- * @param {String} softId - 应用ID
7396
- * @return 无返回值
7397
- * @example softLogById('app123')
7398
- * */
7474
+ * @API user
7475
+ * @desc 存储应用打开记录,统计应用打开次数
7476
+ * @param {String} softId - 应用ID,用于标识具体的应用
7477
+ * @return {void} 无返回值
7478
+ * @example
7479
+ * // 记录应用ID为'app123'的打开次数
7480
+ * user.softLogById('app123');
7481
+ */
7399
7482
  softLogById(e) {
7400
- e && I.timerDebounce(
7483
+ e && j.timerDebounce(
7401
7484
  "loginSoft",
7402
7485
  () => {
7403
- I.request({
7486
+ j.request({
7404
7487
  url: "/wuji-soft-center/softLoginLog/loginSoft",
7405
7488
  method: "POST",
7406
7489
  data: { softId: e }
@@ -7411,13 +7494,21 @@ const rt = {
7411
7494
  },
7412
7495
  /**
7413
7496
  * @doc
7414
- * @API info
7497
+ * @API user
7415
7498
  * @desc 用户登出系统
7416
- * @return {Promise} 返回登出请求的Promise对象
7417
- * @example logOut()
7418
- * */
7499
+ * @return {Promise<Object>} 返回登出请求的Promise对象,包含登出操作的结果
7500
+ * @example
7501
+ * // 执行用户登出
7502
+ * user.logOut()
7503
+ * .then(response => {
7504
+ * console.log('登出成功', response);
7505
+ * })
7506
+ * .catch(error => {
7507
+ * console.error('登出失败', error);
7508
+ * });
7509
+ */
7419
7510
  logOut() {
7420
- return I.request({
7511
+ return j.request({
7421
7512
  url: "/wuji-portal-visual/auth/api/logOut",
7422
7513
  method: "GET",
7423
7514
  timeout: 6e3
@@ -7425,14 +7516,16 @@ const rt = {
7425
7516
  },
7426
7517
  /**
7427
7518
  * @doc
7428
- * @API info
7429
- * @desc 通过别名统计应用打开次数
7430
- * @param {String} softUniqueName - 应用唯一别名
7431
- * @return 无返回值
7432
- * @example softLogByAlias('example-app')
7433
- * */
7519
+ * @API user
7520
+ * @desc 通过应用别名统计应用打开次数
7521
+ * @param {String} softUniqueName - 应用唯一别名,用于标识具体的应用
7522
+ * @return {void} 无返回值
7523
+ * @example
7524
+ * // 通过别名'example-app'记录应用打开次数
7525
+ * user.softLogByAlias('example-app');
7526
+ */
7434
7527
  softLogByAlias(e) {
7435
- e && I.timerDebounce(
7528
+ e && j.timerDebounce(
7436
7529
  "loginSoftByUniqueName",
7437
7530
  () => {
7438
7531
  loginSoftByUniqueName({ softUniqueName: e });
@@ -7440,9 +7533,27 @@ const rt = {
7440
7533
  200
7441
7534
  );
7442
7535
  },
7443
- /** opts.serverType token类型:15s、15s-local、leadal
7444
- * opts.url 传递需要拼接的token地址,支持@token和@15token替换
7445
- * 返回opts,包含url和token
7536
+ /**
7537
+ * @doc
7538
+ * @API user
7539
+ * @desc 设置URL中的Token参数
7540
+ * @param {Object} opts - 配置选项对象
7541
+ * @param {String} opts.serverType - Token类型,可选值:'15s'、'15s-local'、'leadal'
7542
+ * @param {String} opts.url - 需要拼接Token的URL地址,支持@token和@15token占位符替换
7543
+ * @param {String} [opts.id] - 当URL包含@token或@15token占位符时的客户端ID
7544
+ * @return {Promise<Object>} 返回更新后的配置选项对象,包含处理后的URL和Token信息
7545
+ * @throws {Error} 获取Token失败时会抛出异常
7546
+ * @example
7547
+ * // 为URL添加Token参数
7548
+ * const result = await user.setUrlToken({
7549
+ * serverType: 'leadal',
7550
+ * url: 'https://example.com/api/data'
7551
+ * });
7552
+ * // 使用替换占位符
7553
+ * const result2 = await user.setUrlToken({
7554
+ * id: 'client123',
7555
+ * url: 'https://example.com/api/data?token=@token'
7556
+ * });
7446
7557
  */
7447
7558
  async setUrlToken(e) {
7448
7559
  var r, n;
@@ -7457,27 +7568,54 @@ const rt = {
7457
7568
  }
7458
7569
  return ((r = e == null ? void 0 : e.url) == null ? void 0 : r.indexOf("@token")) !== -1 && (t = await s0.getToken(e.id), e.url = e.url.replace("@token", t)), ((n = e == null ? void 0 : e.url) == null ? void 0 : n.indexOf("@15token")) !== -1 && (t = (await s0.get15sToken(e.id)).access_token, e.url = e.url.replace("@15token", t)), e.token = t, e;
7459
7570
  },
7460
- // 传入地址获取token
7571
+ /**
7572
+ * @doc
7573
+ * @API user
7574
+ * @desc 传入地址获取并替换Token
7575
+ * @param {String} url - 包含@token占位符的URL地址
7576
+ * @param {String} clientId - 客户端ID,用于获取Token
7577
+ * @return {Promise<String>} 返回已替换Token的URL字符串
7578
+ * @example
7579
+ * const tokenizedUrl = await user.getUrlToken('https://example.com/api?token=@token', 'client123');
7580
+ */
7461
7581
  async getUrlToken(e, t) {
7462
7582
  let r = "";
7463
7583
  return r = e.replace("@token", (await s0.getToken(t)).access_token), r;
7464
7584
  },
7585
+ /**
7586
+ * @doc
7587
+ * @API user
7588
+ * @param {Object} data - 用户信息对象
7589
+ * @return {Promise<void>} 无返回值
7590
+ * @desc 根据客户端类型,将用户信息存储到不同位置:普通客户端存储到本地存储,特殊客户端通过chrome API存储
7591
+ * @example
7592
+ * // 设置用户信息
7593
+ * await user.setUser({
7594
+ * userId: '12345',
7595
+ * userName: '张三',
7596
+ * roles: ['admin']
7597
+ * });
7598
+ */
7465
7599
  async setUser(e) {
7466
- const t = I.getClientType();
7467
- t !== "ldtC" && t !== "portal" ? I.storage.set("login_user_info_cookie", e, !0) : window.chrome.setUser(e);
7600
+ const t = j.getClientType();
7601
+ t !== "ldtC" && t !== "portal" ? j.storage.set("login_user_info_cookie", e, !0) : window.chrome.setUser(e);
7468
7602
  },
7469
7603
  /**
7470
7604
  * @doc
7471
- * @API info
7472
- * @desc 获取用户信息
7473
- * @return {Object} 用户信息对象
7474
- * @example getUser()
7475
- * */
7605
+ * @API user
7606
+ * @desc 获取用户信息,优先从缓存获取用户信息,如果缓存中不存在,则通过API获取并存储
7607
+ * @return {Promise<Object>} 用户信息对象
7608
+ * @example
7609
+ * // 获取用户信息
7610
+ * const userInfo = await user.getUser();
7611
+ * console.log('用户姓名:', userInfo.userName);
7612
+ * console.log('用户角色:', userInfo.userType);
7613
+ */
7476
7614
  async getUser() {
7477
7615
  var r, n, o;
7478
7616
  let e = "";
7479
- const t = I.getClientType();
7480
- if (t !== "ldtC" && t !== "portal" ? e = await I.storage.get("login_user_info_cookie", !0) : e = await window.chrome.getUser(), e && typeof e == "object" && Object.keys(e).length > 0)
7617
+ const t = j.getClientType();
7618
+ if (t !== "ldtC" && t !== "portal" ? e = await j.storage.get("login_user_info_cookie", !0) : e = await window.chrome.getUser(), e && typeof e == "object" && Object.keys(e).length > 0)
7481
7619
  return e;
7482
7620
  {
7483
7621
  let a = (r = await Ro()) == null ? void 0 : r.data;
@@ -7488,13 +7626,23 @@ const rt = {
7488
7626
  }
7489
7627
  }, ke = { ...rt, ...s0 }, g0 = {
7490
7628
  /**
7491
- * 通过mini打开外部浏览器
7492
- * @param {Object} params
7493
- * url 地址
7494
- * type 浏览器类型
7629
+ * @doc
7630
+ * @API chrome
7631
+ * @desc 通过mini服务调用本地接口打开外部浏览器
7632
+ * @param {Object} params - 浏览器调用参数
7633
+ * @param {string} params.url - 要打开的网页地址
7634
+ * @param {string} params.type - 浏览器类型
7635
+ * @returns {Promise} - 返回请求Promise对象,包含操作结果
7636
+ * @example
7637
+ * chrome.openBrowser({
7638
+ * url: 'https://www.example.com',
7639
+ * type: 'chrome'
7640
+ * }).then(response => {
7641
+ * console.log('浏览器打开结果:', response);
7642
+ * });
7495
7643
  */
7496
7644
  openBrowser(e) {
7497
- return I.request({
7645
+ return j.request({
7498
7646
  url: "http://127.0.0.1:2267/api/mini/BrowserCall/accessBrowser",
7499
7647
  method: "GET",
7500
7648
  withCredentials: !1,
@@ -7502,13 +7650,26 @@ const rt = {
7502
7650
  });
7503
7651
  },
7504
7652
  /**
7505
- * 打开exe 程序
7506
- * @param {Object} params
7653
+ * @doc
7654
+ * @API chrome
7655
+ * @desc 根据客户端类型调用不同的方法打开本地可执行程序
7656
+ * @param {Object} params - 程序执行参数
7657
+ * @param {string} params.path - 可执行程序的路径
7658
+ * @returns {Promise|null} - 返回portal类型下的请求Promise,其他类型返回null
7659
+ * @example
7660
+ * // portal客户端下会返回Promise
7661
+ * chrome.openExec({ path: 'C:/Program Files/example.exe' })
7662
+ * .then(response => {
7663
+ * console.log('程序执行结果:', response);
7664
+ * });
7665
+ *
7666
+ * // ldt或ldtC客户端下直接执行无返回值
7667
+ * chrome.openExec({ path: 'C:/Program Files/example.exe' });
7507
7668
  */
7508
7669
  openExec(e) {
7509
- switch (I.getClientType()) {
7670
+ switch (j.getClientType()) {
7510
7671
  case "portal":
7511
- return I.request({
7672
+ return j.request({
7512
7673
  url: "http://127.0.0.1:2267/api/cis/service/openExec",
7513
7674
  method: "GET",
7514
7675
  withCredentials: !1,
@@ -7521,40 +7682,70 @@ const rt = {
7521
7682
  }
7522
7683
  },
7523
7684
  /**
7524
- * 客户端打开软件
7525
- * * @param {exe} 软件路径
7526
- * * @param {param} token
7527
- * @returns
7685
+ * @doc
7686
+ * @API chrome
7687
+ * @desc 客户端打开指定软件,通过桌面系统服务启动
7688
+ * @param {Object} params - 程序启动参数
7689
+ * @param {string} params.exe - 软件可执行文件路径
7690
+ * @param {string} params.param - 程序启动参数,如token等
7691
+ * @returns {Promise} - 返回请求Promise对象,包含操作结果
7692
+ * @example
7693
+ * chrome.startExec({
7694
+ * exe: 'C:/Program Files/App/example.exe',
7695
+ * param: 'token=abc123'
7696
+ * }).then(response => {
7697
+ * console.log('软件启动结果:', response);
7698
+ * }).catch(error => {
7699
+ * console.error('启动失败:', error);
7700
+ * });
7528
7701
  */
7529
7702
  startExec(e) {
7530
- return I.request({
7703
+ return j.request({
7531
7704
  url: "http://127.0.0.1:2267/api/desktop/sysServer/startExec",
7532
7705
  method: "GET",
7533
7706
  withCredentials: !1,
7534
7707
  params: e
7535
7708
  });
7536
7709
  },
7537
- // 日志记录
7710
+ /**
7711
+ * @doc 打开应用日志
7712
+ * @API chrome
7713
+ * @desc 记录或打开应用日志功能
7714
+ * @note 当前接口暂未实现,函数体为空
7715
+ * @returns {undefined} - 无返回值
7716
+ * @example
7717
+ * // 暂未实现,调用无效果
7718
+ * chrome.openAppLog();
7719
+ */
7538
7720
  openAppLog() {
7539
7721
  },
7540
7722
  /**
7541
- * 获取指纹信息
7723
+ * @doc
7724
+ * @API chrome
7725
+ * @desc 从本地指纹设备获取指纹信息用于登录验证
7726
+ * @returns {Promise} - 返回包含指纹信息的Promise对象
7727
+ * @throws {Error} - 指纹获取超时或失败时抛出异常
7728
+ * @example
7729
+ * chrome.fecthFinger()
7730
+ * .then(fingerprintData => {
7731
+ * console.log('获取到指纹信息:', fingerprintData);
7732
+ * // 进行指纹验证
7733
+ * })
7734
+ * .catch(error => {
7735
+ * console.error('指纹获取失败:', error);
7736
+ * // 提示用户指纹获取失败或超时
7737
+ * });
7542
7738
  */
7543
7739
  fecthFinger() {
7544
- return I.request({
7545
- url: "http://127.0.0.1:2267/api/finger/login/3000",
7546
- method: "GET",
7547
- withCredentials: !1,
7548
- timeout: 5e3
7549
- });
7740
+ return G.get("http://127.0.0.1:2267/api/finger/login/3000");
7550
7741
  }
7551
7742
  }, Qe = {
7552
7743
  /**
7553
7744
  * @doc
7554
- * @API workspace
7745
+ * @API chrome
7555
7746
  * @desc 获取主站聚焦页签信息
7556
7747
  * @param {Function} fn - 回调函数
7557
- * @return 无返回值
7748
+ * @return {Object} tabInfo - 页签信息对象(异步)
7558
7749
  * @example chrome.getWindowActiveTab((tabInfo) => { console.log(tabInfo) })
7559
7750
  * */
7560
7751
  getWindowActiveTab(e) {
@@ -7562,7 +7753,7 @@ const rt = {
7562
7753
  },
7563
7754
  /**
7564
7755
  * @doc
7565
- * @API workspace
7756
+ * @API chrome
7566
7757
  * @desc 打开居中弹窗,按比例显示
7567
7758
  * @param {Number} opt - 窗口大小比例,默认0.85
7568
7759
  * @param {String} url - 要打开的URL地址
@@ -7583,7 +7774,7 @@ const rt = {
7583
7774
  },
7584
7775
  /**
7585
7776
  * @doc
7586
- * @API workspace
7777
+ * @API chrome
7587
7778
  * @desc 打开内嵌窗口
7588
7779
  * @param {Object} opts - 配置项
7589
7780
  * @param {String} opts.url - 地址
@@ -7599,7 +7790,7 @@ const rt = {
7599
7790
  * @example chrome.openWithTab({url: 'https://example.com', title: '示例应用'})
7600
7791
  * */
7601
7792
  async openWithTab(e) {
7602
- e.title = e.title || e.caption || e.name, e.url = e.url || e.homeLink || e.homePage, e.secondLoginValidate === "Y" && (e.url = "/home-client/appAuth.html#/index?target=" + encodeURIComponent(e.url)), e.appId && e.url.startsWith("/") && (e.url = I.getDomainName(e.appId) + e.url), e.audit && g0.openAppLog(e.id), (e.rocketName === "httptoken" || e.authMode === "httptoken" || e.authMode === "token") && (e = await ke.setUrlToken(e)), f0._doOpen(e);
7793
+ e.title = e.title || e.caption || e.name, e.url = e.url || e.homeLink || e.homePage, e.secondLoginValidate === "Y" && (e.url = "/home-client/appAuth.html#/index?target=" + encodeURIComponent(e.url)), e.appId && e.url.startsWith("/") && (e.url = j.getService(e.appId) + e.url), e.audit && g0.openAppLog(e.id), (e.rocketName === "httptoken" || e.authMode === "httptoken" || e.authMode === "token") && (e = await ke.setUrlToken(e)), f0._doOpen(e);
7603
7794
  },
7604
7795
  /**
7605
7796
  * 移动页签,用于弹窗
@@ -7670,19 +7861,34 @@ const rt = {
7670
7861
  }
7671
7862
  };
7672
7863
  let f0 = {
7864
+ /**
7865
+ * @doc
7866
+ * @API chrome
7867
+ * @desc 判断是否为特定客户端环境
7868
+ * @returns {Boolean} 返回是否为特定客户端环境的布尔值
7869
+ * @example
7870
+ * if (_workspace.isClients()) {
7871
+ * console.log('当前在特定客户端环境中');
7872
+ * }
7873
+ */
7673
7874
  isClients() {
7674
7875
  const e = window.navigator.userAgent;
7675
7876
  return (e.indexOf("netiler") !== -1 || e.indexOf("Firefox") !== -1) && typeof window.chrome < "u" && parseInt(window.chrome.version) >= 78;
7676
7877
  },
7677
7878
  /**
7678
7879
  * @doc
7679
- * @API workspace
7880
+ * @API chrome
7680
7881
  * @desc 获取客户端类型及版本信息
7681
- * @return Object {type: String, version: Number} type:客户端类型;version:版本号数字
7682
- * @example chrome.getVersion() => {type: 'portal', version: 304627}
7882
+ * @returns {Object} 包含客户端类型和版本号的对象
7883
+ * @returns {String} returns.type - 客户端类型标识
7884
+ * @returns {Number} returns.version - 客户端版本号数字
7885
+ * @example
7886
+ * const versionInfo = _workspace.getVersion();
7887
+ * console.log('客户端类型:', versionInfo.type); // 输出: portal, ldt或ldtC
7888
+ * console.log('客户端版本号:', versionInfo.version); // 输出: 如304627
7683
7889
  * */
7684
7890
  getVersion() {
7685
- const e = I.getClientType();
7891
+ const e = j.getClientType();
7686
7892
  let t = null;
7687
7893
  if (e == "portal")
7688
7894
  t = parseInt(window.chrome.version);
@@ -7700,20 +7906,24 @@ let f0 = {
7700
7906
  },
7701
7907
  /**
7702
7908
  * @doc
7703
- * @API workspace
7704
- * @desc 刷新全部标签页
7705
- * @return 无返回值
7706
- * @example chrome.refreshAll()
7909
+ * @API chrome
7910
+ * @desc 刷新全部标签页,清除缓存
7911
+ * @returns {void} 无返回值
7912
+ * @example
7913
+ * // 刷新所有标签页并清除缓存
7914
+ * chrome.refreshAll();
7707
7915
  * */
7708
7916
  refreshAll() {
7709
- window.chrome.reloadPAC(), window.chrome.removeCache(), window.chrome.refreshAll();
7917
+ window.chrome.refreshAll();
7710
7918
  },
7711
7919
  /**
7712
7920
  * @doc
7713
- * @API workspace
7921
+ * @API chrome
7714
7922
  * @desc 刷新当前标签页
7715
- * @return 无返回值
7716
- * @example chrome.refresh()
7923
+ * @returns {void} 无返回值
7924
+ * @example
7925
+ * // 刷新当前活动标签页
7926
+ * chrome.refresh();
7717
7927
  * @warning 首页刷新会刷新全部内容
7718
7928
  * */
7719
7929
  refresh() {
@@ -7724,21 +7934,35 @@ let f0 = {
7724
7934
  },
7725
7935
  /**
7726
7936
  * @doc
7727
- * @API workspace
7728
- * @desc 退出客户端
7729
- * @return 无返回值
7730
- * @example chrome.quit()
7937
+ * @API chrome
7938
+ * @desc 退出客户端,先最小化,执行用户登出,再完全退出
7939
+ * @returns {Promise<void>} 无返回值
7940
+ * @throws {Error} 登出过程中可能抛出错误
7941
+ * @example
7942
+ * // 退出客户端
7943
+ * chrome.quit()
7944
+ * .then(() => {
7945
+ * console.log('客户端已退出');
7946
+ * })
7947
+ * .catch(error => {
7948
+ * console.error('退出客户端失败:', error);
7949
+ * });
7731
7950
  * */
7732
7951
  async quit() {
7733
7952
  window.chrome.minimize(), await ke.logOut(), window.chrome.quit();
7734
7953
  },
7735
7954
  /**
7736
7955
  * @doc
7737
- * @API workspace
7738
- * @desc 关闭当前页
7739
- * @param {String} key - 可选参数,指定关闭的标签页key
7740
- * @return 无返回值
7741
- * @example chrome.close()
7956
+ * @API chrome
7957
+ * @desc 关闭当前页或指定标签页
7958
+ * @param {String} [key] - 可选参数,指定要关闭的标签页的唯一标识key
7959
+ * @returns {void} 无返回值
7960
+ * @example
7961
+ * // 关闭当前活动标签页
7962
+ * chrome.close();
7963
+ *
7964
+ * // 关闭指定key的标签页
7965
+ * chrome.close('tab123');
7742
7966
  * */
7743
7967
  close(e) {
7744
7968
  if (f0.isChromeOpen()) {
@@ -7753,13 +7977,16 @@ let f0 = {
7753
7977
  },
7754
7978
  /**
7755
7979
  * @doc
7756
- * @API workspace
7757
- * @desc 客户端最大化
7758
- * @return 无返回值
7759
- * @example chrome.maximize()
7980
+ * @API chrome
7981
+ * @desc 客户端窗口最大化
7982
+ * @returns {void} 无返回值
7983
+ * @description 根据不同客户端类型执行不同的最大化操作:portal类型通过resize方法,ldt/ldtC类型通过maximize方法
7984
+ * @example
7985
+ * // 将客户端窗口最大化
7986
+ * chrome.maximize();
7760
7987
  * */
7761
7988
  maximize() {
7762
- switch (I.getClientType()) {
7989
+ switch (j.getClientType()) {
7763
7990
  case "portal":
7764
7991
  window.chrome.resize(-1, -1);
7765
7992
  break;
@@ -7771,11 +7998,17 @@ let f0 = {
7771
7998
  },
7772
7999
  /**
7773
8000
  * @doc
7774
- * @API workspace
7775
- * @desc 将指定tab扩展至双屏
7776
- * @param {String} windowId - 定义新打开的窗口ID
7777
- * @return 无返回值
7778
- * @example chrome.fullScreen2('window123')
8001
+ * @API chrome
8002
+ * @desc 将指定标签页扩展至双屏显示
8003
+ * @param {String} [windowId] - 新打开窗口的ID,可选,默认使用当前标签页的windowId
8004
+ * @returns {void} 无返回值
8005
+ * @description 将当前活动标签页移动到指定窗口并调整大小以适应双屏显示
8006
+ * @example
8007
+ * // 将当前活动标签页扩展到双屏显示
8008
+ * chrome.fullScreen2();
8009
+ *
8010
+ * // 指定窗口ID将标签页扩展到双屏显示
8011
+ * chrome.fullScreen2('customWindowId');
7779
8012
  * @warning 2020年合同功能点,需要特定环境支持
7780
8013
  * */
7781
8014
  fullScreen2(e) {
@@ -7788,20 +8021,32 @@ let f0 = {
7788
8021
  },
7789
8022
  /**
7790
8023
  * @doc
7791
- * @API workspace
8024
+ * @API chrome
7792
8025
  * @desc 显示首页标签页
7793
- * @return 无返回值
7794
- * @example chrome.showHome()
8026
+ * @returns {void} 无返回值
8027
+ * @example
8028
+ * // 显示首页标签页
8029
+ * chrome.showHome();
7795
8030
  * */
7796
8031
  showHome() {
7797
8032
  return window.chrome.showTab2id("NETILER_BROWSER_DEFAULT");
7798
8033
  },
7799
- getDomainName: I.getDomainName,
7800
8034
  /**
7801
- * 浏览器原生打开页签方式
7802
- */
8035
+ * @doc
8036
+ * @API chrome
8037
+ * @desc 浏览器原生打开页签方式
8038
+ * @param {String|Object} url - 要打开的URL字符串或包含url属性的对象
8039
+ * @returns {void} 无返回值
8040
+ * @description 根据当前环境选择不同的打开方式:客户端环境使用openWithTab,齐安信环境使用openTab2center,其他环境使用window.open
8041
+ * @example
8042
+ * // 使用URL字符串打开
8043
+ * chrome.open('https://example.com');
8044
+ *
8045
+ * // 使用包含url属性的对象打开
8046
+ * chrome.open({ url: 'https://example.com' });
8047
+ * */
7803
8048
  open(e) {
7804
- const t = I.getClientType();
8049
+ const t = j.getClientType();
7805
8050
  if (f0.isChromeOpen())
7806
8051
  this.openWithTab(e);
7807
8052
  else
@@ -7818,11 +8063,38 @@ let f0 = {
7818
8063
  break;
7819
8064
  }
7820
8065
  },
8066
+ /**
8067
+ * @doc
8068
+ * @API chrome
8069
+ * @desc 内部方法:处理各种打开窗口的模式
8070
+ * @param {Object} opts - 打开窗口的配置选项
8071
+ * @param {String} [opts.id] - 窗口唯一标识,如不提供则自动生成
8072
+ * @param {String} [opts.type] - 窗口类型,默认为'_stab'
8073
+ * @param {Number} [opts.winMode] - 窗口打开模式,与openType功能相同
8074
+ * @param {Number} [opts.openType] - 窗口打开模式:1当前窗口;2弹出窗口;3打开外部浏览器;5创建隐藏IFRAME;6弹出独立窗口;7弹出页签窗口;8扩展至第二屏幕;9执行运行程序地址
8075
+ * @param {String} opts.url - 要打开的URL地址
8076
+ * @param {Boolean} [opts.autoFullscreen] - 是否自动全屏
8077
+ * @param {String} [opts.browserType] - 浏览器类型,用于指定打开外部浏览器
8078
+ * @param {Number} [opts.width] - 窗口宽度
8079
+ * @param {Number} [opts.height] - 窗口高度
8080
+ * @param {Number} [opts.left] - 窗口左侧位置
8081
+ * @param {Number} [opts.top] - 窗口顶部位置
8082
+ * @returns {void} 无返回值
8083
+ * @private
8084
+ * @example
8085
+ * // 内部使用示例
8086
+ * chrome._doOpen({
8087
+ * id: 'app123',
8088
+ * url: 'https://example.com',
8089
+ * winMode: 1,
8090
+ * autoFullscreen: true
8091
+ * });
8092
+ */
7821
8093
  // eslint-disable-next-line no-underscore-dangle
7822
8094
  _doOpen(e) {
7823
8095
  e.id || (e.id = "date_id_" + (/* @__PURE__ */ new Date()).getTime()), typeof e.id != "string" && (e.id = e.id.toString()), e.type = e.type || "_stab";
7824
8096
  const t = e.winMode || e.openType;
7825
- if (I.getClientType() === "OnlyWebView")
8097
+ if (j.getClientType() === "OnlyWebView")
7826
8098
  window.chrome.open(e);
7827
8099
  else if (e.url.indexOf(".exe") !== -1 || parseInt(t) === 9)
7828
8100
  g0.openExec({
@@ -7862,8 +8134,26 @@ let f0 = {
7862
8134
  ke.softLogById(e.id);
7863
8135
  },
7864
8136
  /**
7865
- * 打开外部浏览器
7866
- * @param {Object} opts
8137
+ * @doc
8138
+ * @API chrome
8139
+ * @desc 打开外部浏览器访问指定URL
8140
+ * @param {Object} opts - 浏览器打开配置选项
8141
+ * @param {String} opts.url - 要在外部浏览器中打开的URL
8142
+ * @param {Number} [opts.browserType] - 浏览器类型:0默认浏览器;1Firefox;3Chrome;4齐安信浏览器;5齐安信客户端;13InnerChrome
8143
+ * @returns {void} 无返回值
8144
+ * @private
8145
+ * @example
8146
+ * // 打开默认浏览器
8147
+ * chrome._openBrowser({
8148
+ * url: 'https://example.com',
8149
+ * browserType: 0
8150
+ * });
8151
+ *
8152
+ * // 打开Chrome浏览器
8153
+ * chrome._openBrowser({
8154
+ * url: 'https://example.com',
8155
+ * browserType: 3
8156
+ * });
7867
8157
  */
7868
8158
  _openBrowser(e) {
7869
8159
  let t = "", r = decodeURIComponent(e.url);
@@ -7900,10 +8190,31 @@ let f0 = {
7900
8190
  url: r
7901
8191
  }));
7902
8192
  },
7903
- // 打开齐安信客户端
8193
+ /**
8194
+ * @doc
8195
+ * @API chrome
8196
+ * @desc 打开齐安信客户端或浏览器
8197
+ * @param {Object} data - 配置数据
8198
+ * @param {String} data.type - 打开类型,'browser'表示浏览器,'client'表示客户端
8199
+ * @param {String} data.url - 要打开的URL地址
8200
+ * @returns {Promise<void>} 无返回值
8201
+ * @description 根据操作系统和客户端类型,构造命令并通过API调用打开齐安信浏览器或客户端
8202
+ * @example
8203
+ * // 打开齐安信浏览器
8204
+ * chrome.openBrowser2QAX({
8205
+ * type: 'browser',
8206
+ * url: 'https://example.com'
8207
+ * });
8208
+ *
8209
+ * // 打开齐安信客户端
8210
+ * chrome.openBrowser2QAX({
8211
+ * type: 'client',
8212
+ * url: 'https://example.com'
8213
+ * });
8214
+ */
7904
8215
  openBrowser2QAX(e) {
7905
8216
  let { type: t, url: r } = e;
7906
- const n = I.getClientType();
8217
+ const n = j.getClientType();
7907
8218
  if (n === "ldt" || n === "ldtC") {
7908
8219
  window.chrome.openByQax(encodeURI(`--app="${r}"`));
7909
8220
  return;
@@ -7915,20 +8226,48 @@ let f0 = {
7915
8226
  });
7916
8227
  },
7917
8228
  /**
7918
- * 关闭客户端头部
7919
- */
8229
+ * @doc
8230
+ * @API chrome
8231
+ * @desc 关闭客户端头部框架
8232
+ * @param {String} [id] - 要关闭的头部框架ID
8233
+ * @returns {void} 无返回值
8234
+ * @description 仅在ldtC和portal客户端类型中有效,先隐藏再关闭头部框架
8235
+ * @example
8236
+ * // 关闭默认头部框架
8237
+ * chrome.closeHeaderFrame();
8238
+ *
8239
+ * // 关闭指定ID的头部框架
8240
+ * chrome.closeHeaderFrame('header123');
8241
+ * */
7920
8242
  closeHeaderFrame(e) {
7921
- const t = I.getClientType();
8243
+ const t = j.getClientType();
7922
8244
  if (!(t !== "ldtC" && t !== "portal"))
7923
8245
  return window.chrome.hideHeaderFrame(e), window.chrome.closeHeaderFrame(e);
7924
8246
  },
7925
8247
  /**
7926
- * 关闭客户端底部
7927
- */
8248
+ * @doc
8249
+ * @API chrome
8250
+ * @desc 关闭客户端底部框架
8251
+ * @returns {void} 无返回值
8252
+ * @description 先隐藏再关闭底部框架,使用可选链操作符确保兼容性
8253
+ * @example
8254
+ * // 关闭客户端底部框架
8255
+ * chrome.closeFooterFrame();
8256
+ * */
7928
8257
  closeFooterFrame() {
7929
8258
  var e, t;
7930
8259
  return (e = window == null ? void 0 : window.chrome) == null || e.hideFooterFrame(), (t = window == null ? void 0 : window.chrome) == null ? void 0 : t.closeFooterFrame();
7931
8260
  },
8261
+ /**
8262
+ * @doc
8263
+ * @API chrome
8264
+ * @desc 重新尝试指纹登录验证
8265
+ * @returns {Promise<void>} 无返回值
8266
+ * @description 获取指纹信息并验证用户身份,如果验证失败则触发登出
8267
+ * @example
8268
+ * // 重新验证指纹登录
8269
+ * chrome.retryFingerLogin();
8270
+ * */
7932
8271
  retryFingerLogin() {
7933
8272
  g0.fecthFinger().then(async (e) => {
7934
8273
  var t;
@@ -7940,6 +8279,16 @@ let f0 = {
7940
8279
  this.fireLogout();
7941
8280
  });
7942
8281
  },
8282
+ /**
8283
+ * @doc
8284
+ * @API chrome
8285
+ * @desc 触发用户登出操作
8286
+ * @returns {void} 无返回值
8287
+ * @description 退出IM,关闭除首页外的所有窗口,并触发logout2事件
8288
+ * @example
8289
+ * // 触发用户登出流程
8290
+ * chrome.fireLogout();
8291
+ * */
7943
8292
  fireLogout() {
7944
8293
  const e = this;
7945
8294
  this.quitIM();
@@ -7950,31 +8299,62 @@ let f0 = {
7950
8299
  }), e.fireEvent("logout2");
7951
8300
  });
7952
8301
  },
8302
+ /**
8303
+ * @doc
8304
+ * @API chrome
8305
+ * @desc 判断是否在客户端环境中打开
8306
+ * @returns {Boolean} 返回是否在客户端环境中的布尔值
8307
+ * @description 检查当前客户端类型是否为portal、iframe、ldtC、ldt或OnlyWebView
8308
+ * @example
8309
+ * if (_workspace.isChromeOpen()) {
8310
+ * console.log('当前在客户端环境中');
8311
+ * } else {
8312
+ * console.log('当前在普通浏览器环境中');
8313
+ * }
8314
+ */
7953
8315
  isChromeOpen() {
7954
- const e = I.getClientType();
8316
+ const e = j.getClientType();
7955
8317
  return ["portal", "iframe", "ldtC", "ldt", "OnlyWebView"].indexOf(e) !== -1;
7956
- },
7957
- getService() {
7958
- Oo();
7959
8318
  }
7960
8319
  };
7961
- const Za = {
8320
+ const Qa = {
7962
8321
  /**
7963
- * 打开即时通讯
7964
- */
7965
- openIM(e) {
7966
- window.SysService && typeof window.SysService.openNewIM == "function" && mini.getToken("ZHWZ").then((t) => {
7967
- const r = new XMLHttpRequest();
7968
- r.open("GET", "http://127.0.0.1:2069/api/show", !0), r.setRequestHeader("Access-Control-Allow-Origin", "*"), r.timeout = 1e3, r.send(), r.ontimeout = () => {
7969
- window.SysService.openNewIM(t.access_token);
8322
+ * @doc
8323
+ * @API chrome
8324
+ * @desc 打开即时通讯功能
8325
+ * @returns {void} 无返回值
8326
+ * @description 检查系统服务可用性,并通过本地API和token打开即时通讯窗口
8327
+ * @example
8328
+ * // 打开用户即时通讯
8329
+ * chrome.openIM();
8330
+ * @throws {Error} 获取token失败时可能抛出错误
8331
+ * */
8332
+ openIM() {
8333
+ window.SysService && typeof window.SysService.openNewIM == "function" && mini.getToken("ZHWZ").then((e) => {
8334
+ const t = new XMLHttpRequest();
8335
+ t.open("GET", "http://127.0.0.1:2069/api/show", !0), t.setRequestHeader("Access-Control-Allow-Origin", "*"), t.timeout = 1e3, t.send(), t.ontimeout = () => {
8336
+ window.SysService.openNewIM(e.access_token);
7970
8337
  };
7971
- }).catch((t) => {
7972
- console.error(t);
8338
+ }).catch((e) => {
8339
+ console.error(e);
7973
8340
  });
7974
8341
  },
7975
8342
  /**
7976
- * 退出即时通讯
7977
- */
8343
+ * @doc
8344
+ * @API chrome
8345
+ * @desc 退出即时通讯功能
8346
+ * @param {Function} [callback] - 可选的回调函数,在操作完成后执行
8347
+ * @returns {void} 无返回值
8348
+ * @description 通过本地API发送退出请求,设置超时处理,确保在各种情况下都能执行回调
8349
+ * @example
8350
+ * // 退出即时通讯并执行回调
8351
+ * chrome.quitIM(() => {
8352
+ * console.log('退出即时通讯后执行的操作');
8353
+ * });
8354
+ *
8355
+ * // 退出即时通讯不使用回调
8356
+ * im.quitIM();
8357
+ * */
7978
8358
  quitIM(e) {
7979
8359
  const t = new XMLHttpRequest();
7980
8360
  t.open("GET", "http://127.0.0.1:2069/api/quit", !0), t.setRequestHeader("Access-Control-Allow-Origin", "*"), t.send(null);
@@ -7989,8 +8369,18 @@ const Za = {
7989
8369
  }
7990
8370
  }, Ur = {
7991
8371
  /**
7992
- * 78打开弹窗
7993
- * @param {*} options
8372
+ * @doc
8373
+ * @API chrome
8374
+ * @desc 处理弹窗参数并调用openPopup方法显示弹窗
8375
+ * @param {Object} options - 弹窗配置选项
8376
+ * @param {Number} options.width - 弹窗宽度
8377
+ * @param {Number} options.height - 弹窗高度
8378
+ * @param {String} options.src - 弹窗内容源地址
8379
+ * @param {String} options.id - 弹窗唯一标识符
8380
+ * @param {Number} options.top - 弹窗顶部位置
8381
+ * @param {Number} options.left - 弹窗左侧位置
8382
+ * @return {*} 返回openPopup方法的返回值
8383
+ * @example chrome.showPopup78({width: 800, height: 600, src: 'https://example.com', id: 'popup1'})
7994
8384
  */
7995
8385
  showPopup78(e) {
7996
8386
  const t = JSON.parse(JSON.stringify(e, ["width", "height", "src", "id", "top", "left"]));
@@ -7998,91 +8388,130 @@ const Za = {
7998
8388
  },
7999
8389
  /**
8000
8390
  * @doc
8001
- * @API workspace
8002
- * @desc 打开弹窗
8391
+ * @API chrome
8392
+ * @desc 根据客户端类型打开弹窗,非ldtC和portal客户端使用frame模块,否则使用window.chrome
8003
8393
  * @param {Object} data - 弹窗配置
8394
+ * @param {String} data.id - 弹窗ID
8395
+ * @param {Number} data.width - 弹窗宽度
8396
+ * @param {Number} data.height - 弹窗高度
8397
+ * @param {Number} data.left - 弹窗左侧位置
8398
+ * @param {Number} data.top - 弹窗顶部位置
8399
+ * @param {String} data.src - 弹窗内容源地址
8400
+ * @param {Boolean} data.active - 是否立即显示激活,默认为true
8401
+ * @param {Boolean} data.moveable - 是否可拖拽移动,默认false
8004
8402
  * @return 无返回值
8005
- * @example chrome.openPopup({content: '弹窗内容'})
8006
- * */
8403
+ * @example chrome.openPopup({id: 'popup123', width: 800, height: 600, src: 'https://www.baidu.com', top: 200, left: 200})
8404
+ */
8007
8405
  openPopup(e) {
8008
- const t = I.getClientType();
8406
+ const t = j.getClientType();
8009
8407
  t !== "ldtC" && t !== "portal" ? d0.createFrame(e) : window.chrome.openPopup(e);
8010
8408
  },
8011
8409
  /**
8012
8410
  * @doc
8013
- * @API workspace
8014
- * @desc 打开对话框
8015
- * @param {Object} data - 对话框配置
8411
+ * @API chrome
8412
+ * @desc 根据客户端类型打开弹窗,非ldtC和portal客户端使用frame模块,否则使用window.chrome
8413
+ * @param {Object} data - 弹窗配置
8414
+ * @param {String} data.id - 弹窗ID
8415
+ * @param {Number} data.width - 弹窗宽度
8416
+ * @param {Number} data.height - 弹窗高度
8417
+ * @param {Number} data.left - 弹窗左侧位置
8418
+ * @param {Number} data.top - 弹窗顶部位置
8419
+ * @param {String} data.src - 弹窗内容源地址
8420
+ * @param {Boolean} data.active - 是否立即显示激活,默认为true
8421
+ * @param {Boolean} data.moveable - 是否可拖拽移动,默认false
8016
8422
  * @return 无返回值
8017
- * @example chrome.openDialog({title: '提示', content: '确认操作?'})
8018
- * */
8423
+ * @example chrome.openDialog({id: 'popup123', width: 800, height: 600, src: 'https://www.baidu.com', top: 200, left: 200})
8424
+ */
8019
8425
  openDialog(e) {
8020
- const t = I.getClientType();
8426
+ const t = j.getClientType();
8021
8427
  t !== "ldtC" && t !== "portal" ? d0.createFrame(e) : window.chrome.openDialog(e);
8022
8428
  },
8023
8429
  /**
8024
8430
  * @doc
8025
- * @API workspace
8026
- * @desc 关闭弹窗
8431
+ * @API chrome
8432
+ * @desc 根据客户端类型关闭弹窗,非ldtC和portal客户端使用frame模块,否则使用window.chrome
8027
8433
  * @param {String} id - 弹窗ID
8028
8434
  * @return 无返回值
8029
8435
  * @example chrome.closePopup('popup123')
8030
- * */
8436
+ */
8031
8437
  closePopup(e) {
8032
- const t = I.getClientType();
8438
+ const t = j.getClientType();
8033
8439
  t !== "ldtC" && t !== "portal" ? d0.hideLeadalFrame(e) : window.chrome.closePopup(e);
8034
8440
  },
8035
8441
  /**
8036
8442
  * @doc
8037
- * @API workspace
8038
- * @desc 关闭对话框
8443
+ * @API chrome
8444
+ * @desc 根据客户端类型关闭对话框,非ldtC和portal客户端使用frame模块,否则使用window.chrome
8039
8445
  * @param {String} id - 对话框ID
8040
8446
  * @return 无返回值
8041
8447
  * @example chrome.closeDialog('dialog123')
8042
- * */
8448
+ */
8043
8449
  closeDialog(e) {
8044
- const t = I.getClientType();
8450
+ const t = j.getClientType();
8045
8451
  t !== "ldtC" && t !== "portal" ? d0.hideLeadalFrame() : window.chrome.closeDialog(e);
8046
8452
  },
8047
8453
  /**
8048
8454
  * @doc
8049
- * @API workspace
8050
- * @desc 隐藏弹窗
8455
+ * @API chrome
8456
+ * @desc 根据客户端类型隐藏弹窗,非ldtC和portal客户端使用frame模块,否则使用window.chrome
8051
8457
  * @param {String} id - 弹窗ID
8052
8458
  * @return 无返回值
8053
8459
  * @example chrome.hidePopup('popup123')
8054
- * */
8460
+ */
8055
8461
  hidePopup(e) {
8056
- const t = I.getClientType();
8462
+ const t = j.getClientType();
8057
8463
  t !== "ldtC" && t !== "portal" ? d0.hideLeadalFrame(e) : window.chrome.hidePopup(e);
8058
8464
  },
8059
8465
  /**
8060
8466
  * @doc
8061
- * @API workspace
8062
- * @desc 隐藏对话框
8467
+ * @API chrome
8468
+ * @desc 根据客户端类型隐藏对话框,非ldtC和portal客户端使用frame模块,否则使用window.chrome
8063
8469
  * @param {String} id - 对话框ID
8064
8470
  * @return 无返回值
8065
8471
  * @example chrome.hideDialog('dialog123')
8066
- * */
8472
+ */
8067
8473
  hideDialog(e) {
8068
- const t = I.getClientType();
8474
+ const t = j.getClientType();
8069
8475
  t !== "ldtC" && t !== "portal" ? d0.hideLeadalFrame() : window.chrome.hideDialog(e);
8070
8476
  }
8071
8477
  }, Ir = {
8478
+ /**
8479
+ * @doc 获取本地窗口屏幕信息
8480
+ * @API chrome
8481
+ * @desc 根据客户端类型获取本地窗口屏幕信息,portal客户端使用window.chrome.getScreens,其他使用本地服务API
8482
+ * @return {Promise<Object>} 返回包含屏幕信息的Promise对象
8483
+ * @return {number} 返回.code - 状态码,成功为200
8484
+ * @return {Array} 返回.data - 屏幕信息数组
8485
+ * @example chrome.getLocalWindowScreens().then(result => console.log(result.data))
8486
+ * @throws {Error} 获取屏幕信息失败时抛出异常
8487
+ */
8072
8488
  getLocalWindowScreens() {
8073
- return I.getClientType() == "portal" && typeof window.chrome.getScreens == "function" ? new Promise(async (t, r) => {
8489
+ return j.getClientType() == "portal" && typeof window.chrome.getScreens == "function" ? new Promise(async (t, r) => {
8074
8490
  try {
8075
8491
  let o = { code: 200, data: await window.chrome.getScreens() };
8076
8492
  t(o);
8077
8493
  } catch (n) {
8078
8494
  r(n);
8079
8495
  }
8080
- }) : I.request({
8081
- url: "http://127.0.0.1:2267/api/cis/service/getScreens",
8082
- method: "GET",
8083
- withCredentials: !1
8084
- });
8496
+ }) : G.get("http://127.0.0.1:2267/api/cis/service/getScreens");
8085
8497
  },
8498
+ /**
8499
+ * @doc 获取系统信息
8500
+ * @API chrome
8501
+ * @desc 根据客户端类型获取系统信息,portal客户端使用window.chrome.getSystem,其他返回默认空对象
8502
+ * @return {Promise<Object>|Object} 系统信息对象或Promise包装的系统信息对象
8503
+ * @return {string} 返回.electronVersion - Electron版本
8504
+ * @return {string} 返回.appVersion - 应用版本
8505
+ * @return {string} 返回.osType - 操作系统类型
8506
+ * @return {string} 返回.osPlatform - 操作系统平台
8507
+ * @return {string} 返回.osRelease - 操作系统发行版本
8508
+ * @return {string} 返回.osArch - 操作系统架构
8509
+ * @return {string} 返回.osTypeName - 操作系统类型名称
8510
+ * @return {string} 返回.macAddress - MAC地址
8511
+ * @return {Array} 返回.ipAddress - IP地址数组
8512
+ * @return {string} 返回.hostname - 主机名
8513
+ * @example chrome.getSystem().then(sysInfo => console.log(sysInfo.osType))
8514
+ */
8086
8515
  getSystem() {
8087
8516
  return f0.getVersion().type === "portal" && typeof window.chrome.getSystem == "function" ? window.chrome.getSystem() : new Promise((t, r) => {
8088
8517
  t({
@@ -8099,29 +8528,37 @@ const Za = {
8099
8528
  });
8100
8529
  });
8101
8530
  },
8531
+ /**
8532
+ * @doc 获取客户端IP地址
8533
+ * @API chrome
8534
+ * @desc 根据客户端类型和版本获取客户端IP地址,ldtC客户端且版本>=304645使用chrome.getClientIp,其他通过getSystem获取
8535
+ * @return {Promise<string>} 返回IP地址字符串,多个IP用逗号分隔
8536
+ * @example chrome.getClientIp().then(ip => console.log(ip))
8537
+ * @warning 依赖客户端版本,旧版本客户端可能无法正确获取IP
8538
+ */
8102
8539
  async getClientIp() {
8103
8540
  var r, n;
8104
8541
  const e = f0.getVersion();
8105
8542
  let t = "";
8106
8543
  return e.type === "ldtC" && e.version >= 304645 ? t = (r = f0 == null ? void 0 : f0.getClientIp()) == null ? void 0 : r.join(",").replaceAll(" ", "") : t = (n = (await Ir.getSystem()).ipAddress) == null ? void 0 : n.join(",").replaceAll(" ", ""), t;
8107
8544
  }
8108
- }, Ja = {
8545
+ }, Za = {
8109
8546
  ...f0,
8110
- ...Za,
8547
+ ...Qa,
8111
8548
  ...g0,
8112
8549
  ...Ur,
8113
8550
  ...Ir,
8114
8551
  ...Qe
8115
- }, Bi = I, Ci = ke, Ai = Ja, mi = Va, Fi = {
8552
+ }, Ei = j, Bi = ke, Ci = Za, Ai = Ga, mi = {
8116
8553
  LOGO: new URL("../assets/images/logo.png", import.meta.url).href
8117
- }, gi = {
8554
+ }, Fi = {
8118
8555
  Alibaba: new URL("../assets/fonts/Alibaba-PuHuiTi-Medium.ttf", import.meta.url).href
8119
8556
  };
8120
8557
  export {
8121
- gi as FONTS,
8122
- Fi as IMAGES,
8123
- Ai as chrome,
8124
- mi as setBaseURL,
8125
- Ci as user,
8126
- Bi as utils
8558
+ Fi as FONTS,
8559
+ mi as IMAGES,
8560
+ Ci as chrome,
8561
+ Ai as setBaseURL,
8562
+ Bi as user,
8563
+ Ei as utils
8127
8564
  };