diff --git a/server/httpproxy/controllers/proxy.js b/server/httpproxy/controllers/proxy.js index daafe4f..ad1e199 100644 --- a/server/httpproxy/controllers/proxy.js +++ b/server/httpproxy/controllers/proxy.js @@ -1,6 +1,7 @@ const https = require('https'); const app = require('j7/app'); const utils = require('j7/utils'); +const http = require('j7/http'); const serviceFactory = require('../services/factory'); /* @@ -19,7 +20,27 @@ async function get(session) { const seqId = data['seq_id']; const targetUrl = data['target_url']; const cbUrl = data['cb_url']; -} + new Promise((resolve) => { + const {err, response} = await http.get(targetUrl, data['params']); + if (err) { + await http.get(cb, + { + 'errcode': 1, + 'errmsg': '' + err, + 'data': utils.jsonEncode(data), + }); + } else { + await http.get(cb, + { + 'errcode': 0, + 'errmsg': '', + 'data': utils.jsonEncode(data), + 'response': response + }); + } + }); + session.rspOk(); +}; async function post(session) { } diff --git a/third_party/j7 b/third_party/j7 index 4f8f2e8..00c719f 160000 --- a/third_party/j7 +++ b/third_party/j7 @@ -1 +1 @@ -Subproject commit 4f8f2e8a778dffdfbb3f16cd76e6d66fd7641a7f +Subproject commit 00c719fb788fe720665ea7ebe09d95cfa52d1e0b