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.
@@ -38209,8 +38209,16 @@ var normalizeFormInstancePayload = (payload) => {
38209
38209
  };
38210
38210
  };
38211
38211
  var unwrapBusinessResponse = (response) => {
38212
- const result = response?.data || response?.result || response;
38213
- if (result?.success === false) {
38212
+ const isFailureCode = (value) => {
38213
+ if (value === void 0 || value === null || value === "") return false;
38214
+ const code = Number(value);
38215
+ return Number.isFinite(code) && code !== 0 && code !== 200;
38216
+ };
38217
+ if (response?.success === false || isFailureCode(response?.code)) {
38218
+ throw new Error(response.message || response.error || "\u8BF7\u6C42\u5931\u8D25");
38219
+ }
38220
+ const result = response?.data ?? response?.result ?? response;
38221
+ if (result?.success === false || isFailureCode(result?.code)) {
38214
38222
  throw new Error(result.message || response?.message || "\u8BF7\u6C42\u5931\u8D25");
38215
38223
  }
38216
38224
  return result;
@@ -38458,7 +38466,7 @@ function createFormRuntimeApi(config3) {
38458
38466
  method: "post",
38459
38467
  data: payload
38460
38468
  });
38461
- return response.data || response.result || response;
38469
+ return unwrapBusinessResponse(response);
38462
38470
  },
38463
38471
  updateFormData: async (payload) => {
38464
38472
  const data = normalizeFormInstancePayload(payload);
@@ -41851,6 +41859,11 @@ var normalizeBasePath = (basePath) => {
41851
41859
  var inferBasePath = (appType) => {
41852
41860
  if (typeof window === "undefined") return "";
41853
41861
  const pathname = window.location?.pathname || "";
41862
+ const submitMarker = `/submit/${appType}/`;
41863
+ const submitMarkerIndex = pathname.indexOf(submitMarker);
41864
+ if (submitMarkerIndex > 0) {
41865
+ return pathname.slice(0, submitMarkerIndex);
41866
+ }
41854
41867
  const marker = `/${appType}/`;
41855
41868
  const markerIndex = pathname.indexOf(marker);
41856
41869
  if (markerIndex <= 0) return "";