matrix_components 2.0.341 → 2.0.351
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 +3 -3
- package/dist/matrix_components.js +3 -6
- package/dist/matrix_components.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
组件使用示例参考dist/ComponentDemo
|
|
3
3
|
|
|
4
4
|
```
|
|
5
|
-
version:2.0.
|
|
5
|
+
version:2.0.351
|
|
6
6
|
2025-11-24
|
|
7
7
|
更新日志:
|
|
8
8
|
1.修改NsImage组件bug
|
|
@@ -494,8 +494,8 @@ app.use(NsComponents)
|
|
|
494
494
|
// 【可选】401无权显示回调
|
|
495
495
|
app.config.globalProperties.$LogoutCallback = logoutHandler // 无权显示回调
|
|
496
496
|
// 【可选】请求添加的token头的key,默认为satoken。token的key和value需要在外部项目中自己设置
|
|
497
|
-
|
|
498
|
-
|
|
497
|
+
sessionStorage.setItem('tokenName', 'xxx')
|
|
498
|
+
sessionStorage.setItem('tokenValue', 'yyy')
|
|
499
499
|
|
|
500
500
|
// 2. xx.vue / xx.ts 调用获取get、post请求
|
|
501
501
|
import { get, post } from 'matrix_components'
|
|
@@ -76535,7 +76535,7 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
|
|
|
76535
76535
|
* @returns {AxiosRequestConfig} 返回处理后的请求配置对象
|
|
76536
76536
|
*/
|
|
76537
76537
|
(config) => {
|
|
76538
|
-
var _a3, _b, _c2, _d, _e, _f
|
|
76538
|
+
var _a3, _b, _c2, _d, _e, _f;
|
|
76539
76539
|
try {
|
|
76540
76540
|
const requestId = `${Date.now()}_${parseInt(Math.random() * 9999999 + "")}`;
|
|
76541
76541
|
config.requestId = requestId;
|
|
@@ -76550,11 +76550,8 @@ 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.$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 ||
|
|
76554
|
-
|
|
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 || "";
|
|
76556
|
-
console.log(`2===>===>===>===>`, (_j = (_i = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _i.globalProperties) == null ? void 0 : _j.$TonkenValue, tokenName, tokenValue, localStorage.getItem(tokenName), sessionStorage.getItem(tokenName), localStorage.getItem("TonkenValue"), sessionStorage.getItem("TonkenValue"), localStorage.getItem("tonkenValue"), sessionStorage.getItem("tonkenValue"), globalThis.TonkenValue, globalThis.tonkenValue);
|
|
76557
|
-
console.log(`3===>===>===>===>`, sessionStorage);
|
|
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 || "satoken";
|
|
76554
|
+
const tokenValue = ((_f = (_e = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _e.globalProperties) == null ? void 0 : _f.$TokenValue) || localStorage.getItem("TokenValue") || sessionStorage.getItem("TokenValue") || localStorage.getItem("tokenValue") || sessionStorage.getItem("tokenValue") || globalThis.TokenValue || globalThis.tokenValue || "";
|
|
76558
76555
|
if (tokenValue) {
|
|
76559
76556
|
config.headers[tokenName] = tokenValue;
|
|
76560
76557
|
}
|