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.
@@ -3784,8 +3784,16 @@ var normalizeFormInstancePayload = (payload) => {
3784
3784
  };
3785
3785
  };
3786
3786
  var unwrapBusinessResponse = (response) => {
3787
- const result = response?.data || response?.result || response;
3788
- if (result?.success === false) {
3787
+ const isFailureCode = (value) => {
3788
+ if (value === void 0 || value === null || value === "") return false;
3789
+ const code = Number(value);
3790
+ return Number.isFinite(code) && code !== 0 && code !== 200;
3791
+ };
3792
+ if (response?.success === false || isFailureCode(response?.code)) {
3793
+ throw new Error(response.message || response.error || "\u8BF7\u6C42\u5931\u8D25");
3794
+ }
3795
+ const result = response?.data ?? response?.result ?? response;
3796
+ if (result?.success === false || isFailureCode(result?.code)) {
3789
3797
  throw new Error(result.message || response?.message || "\u8BF7\u6C42\u5931\u8D25");
3790
3798
  }
3791
3799
  return result;
@@ -4033,7 +4041,7 @@ function createFormRuntimeApi(config3) {
4033
4041
  method: "post",
4034
4042
  data: payload
4035
4043
  });
4036
- return response.data || response.result || response;
4044
+ return unwrapBusinessResponse(response);
4037
4045
  },
4038
4046
  updateFormData: async (payload) => {
4039
4047
  const data = normalizeFormInstancePayload(payload);
@@ -44846,6 +44854,11 @@ var normalizeBasePath = (basePath) => {
44846
44854
  var inferBasePath = (appType) => {
44847
44855
  if (typeof window === "undefined") return "";
44848
44856
  const pathname = window.location?.pathname || "";
44857
+ const submitMarker = `/submit/${appType}/`;
44858
+ const submitMarkerIndex = pathname.indexOf(submitMarker);
44859
+ if (submitMarkerIndex > 0) {
44860
+ return pathname.slice(0, submitMarkerIndex);
44861
+ }
44849
44862
  const marker = `/${appType}/`;
44850
44863
  const markerIndex = pathname.indexOf(marker);
44851
44864
  if (markerIndex <= 0) return "";