yxuse 3.0.44 → 3.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +33 -2
  2. package/lib/api.es.js +2 -2
  3. package/lib/components.cjs.js +1 -1
  4. package/lib/components.es.js +3 -1
  5. package/lib/index.cjs.js.map +1 -1
  6. package/lib/index.cjs12.js +1 -1
  7. package/lib/index.cjs12.js.gz +0 -0
  8. package/lib/index.cjs12.js.map +1 -1
  9. package/lib/index.cjs5.js +2 -2
  10. package/lib/index.cjs5.js.gz +0 -0
  11. package/lib/index.cjs5.js.map +1 -1
  12. package/lib/index.cjs6.js +3 -3
  13. package/lib/index.cjs6.js.gz +0 -0
  14. package/lib/index.cjs6.js.map +1 -1
  15. package/lib/index.cjs7.js +8 -8
  16. package/lib/index.cjs7.js.gz +0 -0
  17. package/lib/index.cjs7.js.map +1 -1
  18. package/lib/index.es.js.map +1 -1
  19. package/lib/index.es12.js +57 -44
  20. package/lib/index.es12.js.gz +0 -0
  21. package/lib/index.es12.js.map +1 -1
  22. package/lib/index.es4.js +1 -1
  23. package/lib/index.es5.js +3 -2
  24. package/lib/index.es5.js.gz +0 -0
  25. package/lib/index.es5.js.map +1 -1
  26. package/lib/index.es6.js +121 -36
  27. package/lib/index.es6.js.gz +0 -0
  28. package/lib/index.es6.js.map +1 -1
  29. package/lib/index.es7.js +105 -76
  30. package/lib/index.es7.js.gz +0 -0
  31. package/lib/index.es7.js.map +1 -1
  32. package/lib/index.es8.js +1 -1
  33. package/lib/style.css +1 -1
  34. package/lib/style.css.gz +0 -0
  35. package/package.json +3 -2
  36. package/types/api/auth/index.d.ts +1 -0
  37. package/types/components/LogoTitle/index.d.ts +6 -0
  38. package/types/components/LogoTitle/index.vue.d.ts +29 -0
  39. package/types/components/LogoTitle/type.d.ts +5 -0
  40. package/types/components/YxForm/type.d.ts +10 -0
  41. package/types/components/index.d.ts +1 -0
  42. package/types/theme/config.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../packages/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2023-08-16 15:38:34\n * @LastEditors: WangXin\n * @LastEditTime: 2025-04-25 17:41:40\n * @FilePath: /yxuse/packages/index.ts\n * @Description:\n *\n * Copyright (c) 2023 by YuXing, All Rights Reserved.\n */\nexport * as utils from \"./utils\";\n\n// export * as icons from \"./icons\";\nexport * as yxIcon from \"./yxIcon\";\nexport * as api from \"./api\";\nexport * as theme from \"./theme\";\nexport * as components from \"./components\";\nexport * as translate from \"./translate\";\nexport * as yxi18n from \"./yxi18n\";\nexport * from \"./directives\";\nexport * from \"./hooks\";\nexport * from \"./app\";\nexport * from \"./bc\";\n//导出类型\nexport * from \"./components/type\";\nimport * as utils from \"./utils\";\nconsole.log(utils);\n// import * as icons from \"./icons\";\nimport * as api from \"./api\";\nimport * as theme from \"./theme\";\nimport * as components from \"./components\";\nimport * as directives from \"./directives\";\nimport * as translate from \"./translate\";\nimport * as yxi18n from \"./yxi18n\";\nimport * as yxHooks from \"./hooks\";\nimport * as yxIcon from \"./yxIcon\";\nimport * as app from \"./app\";\nimport * as BC from \"./bc\";\nexport default {\n\tutils,\n\tapi,\n\tapp,\n\ttheme,\n\tcomponents,\n\tdirectives,\n\tBC,\n\ttranslate,\n\tyxi18n,\n\tyxHooks,\n\tyxIcon\n};\n"],"names":["utils","api","theme","components","translate","yxi18n","yxIcon"],"mappings":";;;;;;;;;;;;AAsCA,MAAe,QAAA;AAAA,EACd,OAAAA;AAAAA,EACA,KAAAC;AAAAA,EACA;AAAA,EACA,OAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA;AAAA,EACA;AAAA,EACA,WAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA;AAAA,EACA,QAAAC;AACD;"}
1
+ {"version":3,"file":"index.es.js","sources":["../packages/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2023-08-16 15:38:34\n * @LastEditors: WangXin\n * @LastEditTime: 2025-05-08 15:48:37\n * @FilePath: /yxuse/packages/index.ts\n * @Description:\n *\n * Copyright (c) 2023 by YuXing, All Rights Reserved.\n */\nexport * as utils from \"./utils\";\n\n// export * as icons from \"./icons\";\nexport * as yxIcon from \"./yxIcon\";\nexport * as api from \"./api\";\nexport * as theme from \"./theme\";\nexport * as components from \"./components\";\nexport * as translate from \"./translate\";\nexport * as yxi18n from \"./yxi18n\";\nexport * from \"./directives\";\nexport * from \"./hooks\";\nexport * from \"./app\";\nexport * from \"./bc\";\n//导出类型\nexport * from \"./components/type\";\nimport * as utils from \"./utils\";\n\n// import * as icons from \"./icons\";\nimport * as api from \"./api\";\nimport * as theme from \"./theme\";\nimport * as components from \"./components\";\nimport * as directives from \"./directives\";\nimport * as translate from \"./translate\";\nimport * as yxi18n from \"./yxi18n\";\nimport * as yxHooks from \"./hooks\";\nimport * as yxIcon from \"./yxIcon\";\nimport * as app from \"./app\";\nimport * as BC from \"./bc\";\nexport default {\n\tutils,\n\tapi,\n\tapp,\n\ttheme,\n\tcomponents,\n\tdirectives,\n\tBC,\n\ttranslate,\n\tyxi18n,\n\tyxHooks,\n\tyxIcon\n};\n"],"names":["utils","api","theme","components","translate","yxi18n","yxIcon"],"mappings":";;;;;;;;;;;;AAsCA,MAAe,QAAA;AAAA,EACd,OAAAA;AAAAA,EACA,KAAAC;AAAAA,EACA;AAAA,EACA,OAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA;AAAA,EACA;AAAA,EACA,WAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA;AAAA,EACA,QAAAC;AACD;"}
package/lib/index.es12.js CHANGED
@@ -94,6 +94,7 @@ function bind(fn, thisArg) {
94
94
  }
95
95
  const { toString } = Object.prototype;
96
96
  const { getPrototypeOf } = Object;
97
+ const { iterator, toStringTag } = Symbol;
97
98
  const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
98
99
  const str = toString.call(thing);
99
100
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -128,7 +129,7 @@ const isPlainObject = (val) => {
128
129
  return false;
129
130
  }
130
131
  const prototype2 = getPrototypeOf(val);
131
- return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
132
+ return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
132
133
  };
133
134
  const isDate = kindOfTest("Date");
134
135
  const isFile = kindOfTest("File");
@@ -275,10 +276,10 @@ const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
275
276
  };
276
277
  })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
277
278
  const forEachEntry = (obj, fn) => {
278
- const generator = obj && obj[Symbol.iterator];
279
- const iterator = generator.call(obj);
279
+ const generator = obj && obj[iterator];
280
+ const _iterator = generator.call(obj);
280
281
  let result;
281
- while ((result = iterator.next()) && !result.done) {
282
+ while ((result = _iterator.next()) && !result.done) {
282
283
  const pair = result.value;
283
284
  fn.call(obj, pair[0], pair[1]);
284
285
  }
@@ -347,23 +348,8 @@ const noop = () => {
347
348
  const toFiniteNumber = (value, defaultValue) => {
348
349
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
349
350
  };
350
- const ALPHA = "abcdefghijklmnopqrstuvwxyz";
351
- const DIGIT = "0123456789";
352
- const ALPHABET = {
353
- DIGIT,
354
- ALPHA,
355
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
356
- };
357
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
358
- let str = "";
359
- const { length } = alphabet;
360
- while (size--) {
361
- str += alphabet[Math.random() * length | 0];
362
- }
363
- return str;
364
- };
365
351
  function isSpecCompliantForm(thing) {
366
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
352
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
367
353
  }
368
354
  const toJSONObject = (obj) => {
369
355
  const stack = new Array(10);
@@ -409,6 +395,7 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
409
395
  isFunction(_global.postMessage)
410
396
  );
411
397
  const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
398
+ const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
412
399
  const utils$1 = {
413
400
  isArray,
414
401
  isArrayBuffer,
@@ -460,14 +447,13 @@ const utils$1 = {
460
447
  findKey,
461
448
  global: _global,
462
449
  isContextDefined,
463
- ALPHABET,
464
- generateString,
465
450
  isSpecCompliantForm,
466
451
  toJSONObject,
467
452
  isAsyncFn,
468
453
  isThenable,
469
454
  setImmediate: _setImmediate,
470
- asap
455
+ asap,
456
+ isIterable
471
457
  };
472
458
  function AxiosError$1(message, code, config2, request, response) {
473
459
  Error.call(this);
@@ -1087,10 +1073,15 @@ let AxiosHeaders$1 = class AxiosHeaders {
1087
1073
  setHeaders(header, valueOrRewrite);
1088
1074
  } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1089
1075
  setHeaders(parseHeaders(header), valueOrRewrite);
1090
- } else if (utils$1.isHeaders(header)) {
1091
- for (const [key, value] of header.entries()) {
1092
- setHeader(value, key, rewrite);
1076
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
1077
+ let obj = {}, dest, key;
1078
+ for (const entry of header) {
1079
+ if (!utils$1.isArray(entry)) {
1080
+ throw TypeError("Object iterator must return a key-value pair");
1081
+ }
1082
+ obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
1093
1083
  }
1084
+ setHeaders(obj, valueOrRewrite);
1094
1085
  } else {
1095
1086
  header != null && setHeader(valueOrRewrite, header, rewrite);
1096
1087
  }
@@ -1194,6 +1185,9 @@ let AxiosHeaders$1 = class AxiosHeaders {
1194
1185
  toString() {
1195
1186
  return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
1196
1187
  }
1188
+ getSetCookie() {
1189
+ return this.get("set-cookie") || [];
1190
+ }
1197
1191
  get [Symbol.toStringTag]() {
1198
1192
  return "AxiosHeaders";
1199
1193
  }
@@ -1414,8 +1408,9 @@ function isAbsoluteURL(url) {
1414
1408
  function combineURLs(baseURL, relativeURL) {
1415
1409
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1416
1410
  }
1417
- function buildFullPath(baseURL, requestedURL) {
1418
- if (baseURL && !isAbsoluteURL(requestedURL)) {
1411
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
1412
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
1413
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
1419
1414
  return combineURLs(baseURL, requestedURL);
1420
1415
  }
1421
1416
  return requestedURL;
@@ -1502,7 +1497,7 @@ const resolveConfig = (config2) => {
1502
1497
  const newConfig = mergeConfig$1({}, config2);
1503
1498
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
1504
1499
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
1505
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config2.params, config2.paramsSerializer);
1500
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config2.params, config2.paramsSerializer);
1506
1501
  if (auth) {
1507
1502
  headers.set(
1508
1503
  "Authorization",
@@ -1741,7 +1736,7 @@ const readStream = function(stream) {
1741
1736
  });
1742
1737
  };
1743
1738
  const trackStream = (stream, chunkSize, onProgress, onFinish) => {
1744
- const iterator = readBytes(stream, chunkSize);
1739
+ const iterator2 = readBytes(stream, chunkSize);
1745
1740
  let bytes = 0;
1746
1741
  let done;
1747
1742
  let _onFinish = (e) => {
@@ -1754,7 +1749,7 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
1754
1749
  pull(controller) {
1755
1750
  return __async(this, null, function* () {
1756
1751
  try {
1757
- const { done: done2, value } = yield iterator.next();
1752
+ const { done: done2, value } = yield iterator2.next();
1758
1753
  if (done2) {
1759
1754
  _onFinish();
1760
1755
  controller.close();
@@ -1774,7 +1769,7 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
1774
1769
  },
1775
1770
  cancel(reason) {
1776
1771
  _onFinish(reason);
1777
- return iterator.return();
1772
+ return iterator2.return();
1778
1773
  }
1779
1774
  }, {
1780
1775
  highWaterMark: 2
@@ -1932,7 +1927,7 @@ const fetchAdapter = isFetchSupported && ((config2) => __async(void 0, null, fun
1932
1927
  });
1933
1928
  } catch (err) {
1934
1929
  unsubscribe && unsubscribe();
1935
- if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
1930
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
1936
1931
  throw Object.assign(
1937
1932
  new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config2, request),
1938
1933
  {
@@ -2038,7 +2033,7 @@ function dispatchRequest(config2) {
2038
2033
  return Promise.reject(reason);
2039
2034
  });
2040
2035
  }
2041
- const VERSION$1 = "1.7.9";
2036
+ const VERSION$1 = "1.9.0";
2042
2037
  const validators$1 = {};
2043
2038
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
2044
2039
  validators$1[type] = function validator2(thing) {
@@ -2097,7 +2092,7 @@ const validator = {
2097
2092
  const validators = validator.validators;
2098
2093
  let Axios$1 = class Axios {
2099
2094
  constructor(instanceConfig) {
2100
- this.defaults = instanceConfig;
2095
+ this.defaults = instanceConfig || {};
2101
2096
  this.interceptors = {
2102
2097
  request: new InterceptorManager(),
2103
2098
  response: new InterceptorManager()
@@ -2161,6 +2156,12 @@ let Axios$1 = class Axios {
2161
2156
  }, true);
2162
2157
  }
2163
2158
  }
2159
+ if (config2.allowAbsoluteUrls !== void 0) ;
2160
+ else if (this.defaults.allowAbsoluteUrls !== void 0) {
2161
+ config2.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
2162
+ } else {
2163
+ config2.allowAbsoluteUrls = true;
2164
+ }
2164
2165
  validator.assertOptions(config2, {
2165
2166
  baseUrl: validators.spelling("baseURL"),
2166
2167
  withXsrfToken: validators.spelling("withXSRFToken")
@@ -2231,7 +2232,7 @@ let Axios$1 = class Axios {
2231
2232
  }
2232
2233
  getUri(config2) {
2233
2234
  config2 = mergeConfig$1(this.defaults, config2);
2234
- const fullPath = buildFullPath(config2.baseURL, config2.url);
2235
+ const fullPath = buildFullPath(config2.baseURL, config2.url, config2.allowAbsoluteUrls);
2235
2236
  return buildURL(fullPath, config2.params, config2.paramsSerializer);
2236
2237
  }
2237
2238
  };
@@ -2614,6 +2615,13 @@ const getUserIsHaveBtnPower = (routeTag) => {
2614
2615
  const authButtonListGet = (_a = sessionStorage.getItem("ttcUserBtnList")) != null ? _a : "[]";
2615
2616
  return JSON.parse(authButtonListGet).includes(routeTag);
2616
2617
  };
2618
+ let userConfig = null;
2619
+ const getUserConfig = () => __async(void 0, null, function* () {
2620
+ if (userConfig) return userConfig;
2621
+ const { data } = yield http.get(getSystemConfig("userConfigApiUrl"), {}, { headers: { noLoading: true } });
2622
+ userConfig = data;
2623
+ return data;
2624
+ });
2617
2625
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2618
2626
  __proto__: null,
2619
2627
  autoLogin,
@@ -2622,6 +2630,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
2622
2630
  getLoginUrl,
2623
2631
  getSystemConfig,
2624
2632
  getToken,
2633
+ getUserConfig,
2625
2634
  getUserInfo,
2626
2635
  getUserIsHaveBtnPower,
2627
2636
  getUserPermissions,
@@ -2681,6 +2690,9 @@ const checkStatus = (status, msg) => {
2681
2690
  break;
2682
2691
  case 401:
2683
2692
  ElMessage.error(msg || "登录失效!请您重新登录");
2693
+ if (!location.href.includes(getLoginUrl())) {
2694
+ jumpToLogin();
2695
+ }
2684
2696
  break;
2685
2697
  case 403:
2686
2698
  ElMessage.error(msg || "当前账号无权限访问!");
@@ -2782,14 +2794,13 @@ class YxHttp {
2782
2794
  );
2783
2795
  }
2784
2796
  handleOverdueResponse(data) {
2785
- removeToken();
2786
- jumpToLogin();
2787
2797
  ElNotification({
2788
2798
  title: "登录过期提醒",
2789
2799
  message: data.resultMsg || "当前登录失效",
2790
2800
  type: "warning",
2791
2801
  duration: 5e3
2792
2802
  });
2803
+ jumpToLogin();
2793
2804
  return Promise.reject(data);
2794
2805
  }
2795
2806
  handleErrorResponse(data) {
@@ -2840,15 +2851,17 @@ export {
2840
2851
  BC_LANG_NAME as B,
2841
2852
  URL$1 as U,
2842
2853
  http as a,
2843
- getUserIsHaveBtnPower as b,
2854
+ getUserConfig as b,
2844
2855
  checkStatus as c,
2845
- changeSystemConfig as d,
2846
- getSystemConfig as e,
2847
- BC_THEME_NAME as f,
2856
+ getUserIsHaveBtnPower as d,
2857
+ changeSystemConfig as e,
2858
+ getSystemConfig as f,
2848
2859
  getToken as g,
2849
2860
  hideFullScreenLoading as h,
2850
- setSystemConfig as i,
2851
- index as j,
2861
+ BC_THEME_NAME as i,
2862
+ jumpToHome as j,
2863
+ setSystemConfig as k,
2864
+ index as l,
2852
2865
  showFullScreenLoading as s
2853
2866
  };
2854
2867
  //# sourceMappingURL=index.es12.js.map
Binary file