@xuda.io/xuda-worker-bundle-min 1.3.318 → 1.3.319
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/index.js +22 -9
- 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
|
-
|
|
1787
|
-
|
|
1788
|
-
{
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
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.dataSourceUrl == "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
|
|