@xuda.io/xuda-worker-bundle-min 1.3.318 → 1.3.320

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.
Files changed (2) hide show
  1. package/index.js +22 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1783,16 +1783,28 @@ func.datasource.execute = async function (
1783
1783
  case "url": {
1784
1784
  debugger;
1785
1785
 
1786
- const response = await fetch(
1787
- `https://${_session.domain}/cpi/get_utc_ts`,
1788
- {
1789
- method: "POST",
1790
- headers: {
1791
- Accept: "application/json",
1792
- "Content-Type": "application/json",
1793
- },
1794
- body: JSON.stringify({}),
1786
+ let opt = {
1787
+ method: prog_obj.progDataSource.dataSourceMethod || "POST",
1788
+ headers: {
1789
+ Accept: "application/json",
1790
+ "Content-Type": "application/json",
1791
+ },
1792
+ };
1793
+ let data = {};
1794
+ if (
1795
+ prog_obj.progDataSource.dataSourceMethod == "POST" &&
1796
+ prog_obj.progDataSource.dataSourceParameters
1797
+ ) {
1798
+ for (let val of prog_obj.progDataSource.dataSourceParameters) {
1799
+ data[val.key] = val.val;
1795
1800
  }
1801
+
1802
+ opt.body = JSON.stringify(data);
1803
+ }
1804
+
1805
+ const response = await fetch(
1806
+ prog_obj.progDataSource.dataSourceUrl,
1807
+ opt
1796
1808
  );
1797
1809
  const json = await response.json();
1798
1810
  return json.data;
@@ -1801,6 +1813,7 @@ func.datasource.execute = async function (
1801
1813
  }
1802
1814
 
1803
1815
  default:
1816
+ return null;
1804
1817
  break;
1805
1818
  }
1806
1819
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.318",
3
+ "version": "1.3.320",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {