matrix_components 2.0.437 → 2.0.439
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 +7 -0
- package/dist/matrix_components.js +15 -5
- package/dist/matrix_components.umd.cjs +1 -1
- package/package.json +2 -1
- package/dist/ComponentDemo/WordDemo.vue +0 -191
package/README.md
CHANGED
|
@@ -58307,11 +58307,12 @@ function safeExecuteCallback(callback, error, message) {
|
|
|
58307
58307
|
if (typeof callback === "function") {
|
|
58308
58308
|
try {
|
|
58309
58309
|
console.log("执行错误回调函数:", { error, message });
|
|
58310
|
-
callback(error, message);
|
|
58310
|
+
return callback(error, message);
|
|
58311
58311
|
} catch (callbackError) {
|
|
58312
58312
|
console.error("错误回调函数执行失败:", callbackError);
|
|
58313
58313
|
}
|
|
58314
58314
|
}
|
|
58315
|
+
return false;
|
|
58315
58316
|
}
|
|
58316
58317
|
function createAxiosInstance(customConfig = {}, errorCallback) {
|
|
58317
58318
|
if (axiosInstance) {
|
|
@@ -58430,12 +58431,18 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
|
|
|
58430
58431
|
if (status !== ResultEnum.SUCCESS) {
|
|
58431
58432
|
const formatMsg = await errorStatus(status);
|
|
58432
58433
|
console.error(formatMsg || "接口解析错误");
|
|
58433
|
-
safeExecuteCallback(axiosInstance.errorCallback, { status, response }, formatMsg);
|
|
58434
|
+
const isResolve = safeExecuteCallback(axiosInstance.errorCallback, { status, response }, formatMsg);
|
|
58435
|
+
if (isResolve) {
|
|
58436
|
+
return Promise.resolve(null);
|
|
58437
|
+
}
|
|
58434
58438
|
return Promise.reject(null);
|
|
58435
58439
|
} else if (data.code !== ResultEnum.SUCCESS) {
|
|
58436
58440
|
const formatMsg = await errorStatus(data == null ? void 0 : data.code, data == null ? void 0 : data.msg);
|
|
58437
58441
|
console.error(formatMsg || "接口解析错误");
|
|
58438
|
-
safeExecuteCallback(axiosInstance.errorCallback, { code: data == null ? void 0 : data.code, data, response }, formatMsg);
|
|
58442
|
+
const isResolve = safeExecuteCallback(axiosInstance.errorCallback, { code: data == null ? void 0 : data.code, data, response }, formatMsg);
|
|
58443
|
+
if (isResolve) {
|
|
58444
|
+
return Promise.resolve(null);
|
|
58445
|
+
}
|
|
58439
58446
|
return Promise.reject(null);
|
|
58440
58447
|
}
|
|
58441
58448
|
return data == null ? void 0 : data.data;
|
|
@@ -58456,8 +58463,11 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
|
|
|
58456
58463
|
}
|
|
58457
58464
|
const formatMsg = await errorFn(error);
|
|
58458
58465
|
console.error(formatMsg || "接口解析错误");
|
|
58459
|
-
safeExecuteCallback(axiosInstance.errorCallback, error, formatMsg);
|
|
58460
|
-
|
|
58466
|
+
const isResolve = safeExecuteCallback(axiosInstance.errorCallback, error, formatMsg);
|
|
58467
|
+
if (isResolve) {
|
|
58468
|
+
return Promise.resolve(null);
|
|
58469
|
+
}
|
|
58470
|
+
return Promise.reject(null);
|
|
58461
58471
|
}
|
|
58462
58472
|
);
|
|
58463
58473
|
return axiosInstance;
|