matrix_components 2.0.338 → 2.0.340

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/README.md CHANGED
@@ -494,7 +494,7 @@ app.use(NsComponents)
494
494
  // 【可选】401无权显示回调
495
495
  app.config.globalProperties.$LogoutCallback = logoutHandler // 无权显示回调
496
496
  // 【可选】请求添加的token头的key,默认为satoken。token的key和value需要在外部项目中自己设置
497
- app.config.globalProperties.$TonkenKey = "tokenName"
497
+ app.config.globalProperties.$TokenName = "tokenName"
498
498
  app.config.globalProperties.$TonkenValue = "xxxx";
499
499
 
500
500
  // 2. xx.vue / xx.ts 调用获取get、post请求
@@ -76535,7 +76535,7 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
76535
76535
  * @returns {AxiosRequestConfig} 返回处理后的请求配置对象
76536
76536
  */
76537
76537
  (config) => {
76538
- var _a3, _b, _c2, _d;
76538
+ var _a3, _b, _c2, _d, _e, _f, _g, _h2;
76539
76539
  try {
76540
76540
  const requestId = `${Date.now()}_${parseInt(Math.random() * 9999999 + "")}`;
76541
76541
  config.requestId = requestId;
@@ -76550,8 +76550,9 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
76550
76550
  } catch (error) {
76551
76551
  console.error("请求的ID生成失败:", error);
76552
76552
  }
76553
- const tokenName = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$TonkenKey) || localStorage.getItem("TonkenKey") || localStorage.getItem("tonkenKey") || sessionStorage.getItem("TonkenKey") || sessionStorage.getItem("tonkenKey") || globalThis.TonkenKey || globalThis.tonkenKey || "satoken";
76554
- const tokenValue = ((_d = (_c2 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$TonkenValue) || localStorage.getItem(tokenName) || sessionStorage.getItem(tokenName) || localStorage.getItem("TonkenValue") || sessionStorage.getItem("TonkenValue") || localStorage.getItem("tonkenValue") || sessionStorage.getItem("tonkenValue") || globalThis.TonkenValue || globalThis.tonkenValue || "";
76553
+ const tokenName = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$TokenName) || ((_d = (_c2 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$TonkenKey) || localStorage.getItem("TokenName") || localStorage.getItem("tokenName") || sessionStorage.getItem("TokenName") || sessionStorage.getItem("tokenName") || globalThis.TokenName || globalThis.tokenName || localStorage.getItem("TonkenKey") || localStorage.getItem("tonkenKey") || sessionStorage.getItem("TonkenKey") || sessionStorage.getItem("tonkenKey") || globalThis.TonkenKey || globalThis.tonkenKey || "satoken";
76554
+ console.log(`1===>===>===>===>`, (_f = (_e = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _e.globalProperties) == null ? void 0 : _f.$TonkenValue, tokenName, localStorage.getItem(tokenName), sessionStorage.getItem(tokenName), localStorage.getItem("TonkenValue"), sessionStorage.getItem("tonkenValue"), globalThis.TonkenValue, globalThis.tonkenValue);
76555
+ const tokenValue = ((_h2 = (_g = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _g.globalProperties) == null ? void 0 : _h2.$TonkenValue) || localStorage.getItem(tokenName) || sessionStorage.getItem(tokenName) || localStorage.getItem("TonkenValue") || sessionStorage.getItem("TonkenValue") || localStorage.getItem("tonkenValue") || sessionStorage.getItem("tonkenValue") || globalThis.TonkenValue || globalThis.tonkenValue || "";
76555
76556
  if (tokenValue) {
76556
76557
  config.headers[tokenName] = tokenValue;
76557
76558
  }