This commit is contained in:
aozhiwei 2022-03-26 15:32:25 +08:00
commit b330591414
3 changed files with 12 additions and 3 deletions

View File

@ -6,6 +6,7 @@ function add(name) {
} }
function init() { function init() {
add('proxy');
} }
function create(name) { function create(name) {

View File

@ -16,12 +16,14 @@ const serviceFactory = require('../services/factory');
} }
*/ */
async function get(session) { async function get(session) {
console.log('1111');
const data = utils.jsonDecode(session.request('data', '')); const data = utils.jsonDecode(session.request('data', ''));
const seqId = data['seq_id']; const seqId = data['seq_id'];
const targetUrl = data['target_url']; const targetUrl = data['target_url'];
const cbUrl = data['cb_url']; const cbUrl = data['cb_url'];
new Promise((resolve) => { new Promise(async (resolve) => {
const {err, response} = await http.get(targetUrl, data['params']); const {err, response} = await http.get(targetUrl, data['params']);
console.log('response:' + response);
if (err) { if (err) {
await http.get(cb, await http.get(cb,
{ {

View File

@ -14,9 +14,12 @@
"../../third_party/j7": { "../../third_party/j7": {
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"axios": "^0.26.1",
"crc-32": "^1.2.1", "crc-32": "^1.2.1",
"express": "^4.17.2", "express": "^4.17.2",
"mysql": "~2.18.1" "mysql": "~2.18.1",
"querystring": "^0.2.1",
"urlencode": "^1.1.0"
} }
}, },
"node_modules/j7": { "node_modules/j7": {
@ -28,9 +31,12 @@
"j7": { "j7": {
"version": "file:../../third_party/j7", "version": "file:../../third_party/j7",
"requires": { "requires": {
"axios": "^0.26.1",
"crc-32": "^1.2.1", "crc-32": "^1.2.1",
"express": "^4.17.2", "express": "^4.17.2",
"mysql": "~2.18.1" "mysql": "~2.18.1",
"querystring": "^0.2.1",
"urlencode": "^1.1.0"
} }
} }
} }