Commit 34e797e3 authored by rockyl's avatar rockyl

晚上代码同步服务

parent b9a5f08a
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -36,11 +36,10 @@ ...@@ -36,11 +36,10 @@
}, },
"output": [ "output": [
"success", "success",
"failed",
"exception" "exception"
], ],
"id": "http-request", "id": "http-request",
"script": "var url = engine.findVariable('url', args, props);\nvar type = engine.findVariable('type', args, props);\nvar params = engine.findVariable('params', args, props);\nvar headers = engine.findVariable('headers', args, props);\nif (!url) {\n console.log('url is empty');\n next('exception', '\\'url is empty\\'');\n}\nelse {\n engine.httpRequest(url, props.method, params, type, headers)\n .then(function (data) {\n next('success', data);\n }, function (err) {\n next('failed', err);\n });\n}\n", "script": "var url = engine.findVariable('url', args, props);\nvar type = engine.findVariable('type', args, props);\nvar params = engine.findVariable('params', args, props);\nvar headers = engine.findVariable('headers', args, props);\nif (!url) {\n console.log('url is empty');\n next('exception', 'url is empty');\n}\nelse {\n engine.httpRequest(url, props.method, params, type, headers)\n .then(function (data) {\n next('success', data);\n }, function (err) {\n next('exception', err);\n });\n}\n",
"group": "net", "group": "net",
"type": "builtin" "type": "builtin"
} }
This diff is collapsed.
...@@ -9,7 +9,7 @@ const headers = engine.findVariable('headers', args, props); ...@@ -9,7 +9,7 @@ const headers = engine.findVariable('headers', args, props);
if (!url) { if (!url) {
console.log('url is empty'); console.log('url is empty');
next('exception', '\'url is empty\''); next('exception', 'url is empty');
} else { } else {
engine.httpRequest(url, props.method, params, type, headers) engine.httpRequest(url, props.method, params, type, headers)
.then( .then(
...@@ -17,7 +17,7 @@ if (!url) { ...@@ -17,7 +17,7 @@ if (!url) {
next('success', data); next('success', data);
}, },
err => { err => {
next('failed', err); next('exception', err);
} }
); );
} }
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
"params": {"type": "map", "alias": "参数" }, "params": {"type": "map", "alias": "参数" },
"headers": {"type": "map", "alias": "头部" } "headers": {"type": "map", "alias": "头部" }
}, },
"output": ["success", "failed", "exception"] "output": ["success", "exception"]
} }
\ No newline at end of file
console.log(args);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment