matrix_components 2.0.328 → 2.0.329
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.
|
@@ -76545,8 +76545,8 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
|
|
|
76545
76545
|
} catch (error) {
|
|
76546
76546
|
console.error("请求的ID生成失败:", error);
|
|
76547
76547
|
}
|
|
76548
|
-
const tokenName = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b
|
|
76549
|
-
const tokenValue = ((_d = (_c2 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d
|
|
76548
|
+
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";
|
|
76549
|
+
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 || "";
|
|
76550
76550
|
if (tokenValue) {
|
|
76551
76551
|
config.headers[tokenName] = tokenValue;
|
|
76552
76552
|
}
|
|
@@ -76629,6 +76629,7 @@ async function errorFn(error) {
|
|
|
76629
76629
|
return "网络连接错误";
|
|
76630
76630
|
}
|
|
76631
76631
|
async function errorStatus(status, message = "") {
|
|
76632
|
+
var _a3, _b;
|
|
76632
76633
|
if (!message) {
|
|
76633
76634
|
switch (status) {
|
|
76634
76635
|
case 302:
|
|
@@ -76677,8 +76678,12 @@ async function errorStatus(status, message = "") {
|
|
|
76677
76678
|
}
|
|
76678
76679
|
if (message !== "ok") ElMessage.warning(message);
|
|
76679
76680
|
if (status === 401) {
|
|
76680
|
-
|
|
76681
|
-
|
|
76681
|
+
try {
|
|
76682
|
+
const logoutHandler = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$LogoutCallback) || "";
|
|
76683
|
+
logoutHandler == null ? void 0 : logoutHandler();
|
|
76684
|
+
} catch (error) {
|
|
76685
|
+
console.warn("组件库未找到注销回调函数", error);
|
|
76686
|
+
}
|
|
76682
76687
|
}
|
|
76683
76688
|
return message;
|
|
76684
76689
|
}
|
|
@@ -76689,7 +76694,7 @@ function setHttpApp(_app) {
|
|
|
76689
76694
|
}
|
|
76690
76695
|
function getBaseUrl() {
|
|
76691
76696
|
var _a3, _b;
|
|
76692
|
-
return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b
|
|
76697
|
+
return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$BaseUrl) || localStorage.getItem("BaseUrl") || localStorage.getItem("bseUrl") || sessionStorage.getItem("BaseUrl") || sessionStorage.getItem("bseUrl") || globalThis.BaseUrl || globalThis.bseUrl || "";
|
|
76693
76698
|
}
|
|
76694
76699
|
const get = async (url, params, base = "", customConfig = {}, errorCallback = null) => {
|
|
76695
76700
|
const baseUrl = base || getBaseUrl();
|