openxiangda 1.0.47 → 1.0.49
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/package.json +1 -1
- package/packages/sdk/dist/components/index.cjs +16 -3
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.mjs +16 -3
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +16 -3
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.mjs +16 -3
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
|
@@ -3682,8 +3682,16 @@ var normalizeFormInstancePayload = (payload) => {
|
|
|
3682
3682
|
};
|
|
3683
3683
|
};
|
|
3684
3684
|
var unwrapBusinessResponse = (response) => {
|
|
3685
|
-
const
|
|
3686
|
-
|
|
3685
|
+
const isFailureCode = (value) => {
|
|
3686
|
+
if (value === void 0 || value === null || value === "") return false;
|
|
3687
|
+
const code = Number(value);
|
|
3688
|
+
return Number.isFinite(code) && code !== 0 && code !== 200;
|
|
3689
|
+
};
|
|
3690
|
+
if (response?.success === false || isFailureCode(response?.code)) {
|
|
3691
|
+
throw new Error(response.message || response.error || "\u8BF7\u6C42\u5931\u8D25");
|
|
3692
|
+
}
|
|
3693
|
+
const result = response?.data ?? response?.result ?? response;
|
|
3694
|
+
if (result?.success === false || isFailureCode(result?.code)) {
|
|
3687
3695
|
throw new Error(result.message || response?.message || "\u8BF7\u6C42\u5931\u8D25");
|
|
3688
3696
|
}
|
|
3689
3697
|
return result;
|
|
@@ -3931,7 +3939,7 @@ function createFormRuntimeApi(config3) {
|
|
|
3931
3939
|
method: "post",
|
|
3932
3940
|
data: payload
|
|
3933
3941
|
});
|
|
3934
|
-
return response
|
|
3942
|
+
return unwrapBusinessResponse(response);
|
|
3935
3943
|
},
|
|
3936
3944
|
updateFormData: async (payload) => {
|
|
3937
3945
|
const data = normalizeFormInstancePayload(payload);
|
|
@@ -43947,6 +43955,11 @@ var normalizeBasePath = (basePath) => {
|
|
|
43947
43955
|
var inferBasePath = (appType) => {
|
|
43948
43956
|
if (typeof window === "undefined") return "";
|
|
43949
43957
|
const pathname = window.location?.pathname || "";
|
|
43958
|
+
const submitMarker = `/submit/${appType}/`;
|
|
43959
|
+
const submitMarkerIndex = pathname.indexOf(submitMarker);
|
|
43960
|
+
if (submitMarkerIndex > 0) {
|
|
43961
|
+
return pathname.slice(0, submitMarkerIndex);
|
|
43962
|
+
}
|
|
43950
43963
|
const marker = `/${appType}/`;
|
|
43951
43964
|
const markerIndex = pathname.indexOf(marker);
|
|
43952
43965
|
if (markerIndex <= 0) return "";
|