|
@@ -405,23 +405,20 @@ async function wRequest(type = 'post', url, { data: data, headers: headers }) {
|
|
|
enData: Base64.encode(encryptAES(JSON.stringify(data), aesKey)),
|
|
enData: Base64.encode(encryptAES(JSON.stringify(data), aesKey)),
|
|
|
aesKey: Base64.encode(encryptRSA(aesKey))
|
|
aesKey: Base64.encode(encryptRSA(aesKey))
|
|
|
} : data;
|
|
} : data;
|
|
|
- lk.log("#########################6");
|
|
|
|
|
let urlList = ['/open/api/generateLink', '/api/kBankConfig/findByKey', '/api/wBankConfig/findByKey', '/api/gejin/gjj/clickCount', '/api/puhui/referrer/activityConfig', '/api/puhui/referrer/regedit', '/api/puhui/referrer/query', '/api/kBankConfig/findByKey', '/api/puhui/referrer/receiveAward', '/api/puhui/referrer/draw', '/api/puhui/referrer/activityConfig', '/api/puhui/referrer/noDrawNum']
|
|
let urlList = ['/open/api/generateLink', '/api/kBankConfig/findByKey', '/api/wBankConfig/findByKey', '/api/gejin/gjj/clickCount', '/api/puhui/referrer/activityConfig', '/api/puhui/referrer/regedit', '/api/puhui/referrer/query', '/api/kBankConfig/findByKey', '/api/puhui/referrer/receiveAward', '/api/puhui/referrer/draw', '/api/puhui/referrer/activityConfig', '/api/puhui/referrer/noDrawNum']
|
|
|
let apiUrl = urlList.includes(url) ? ajaxCommonUrl + url : ajaxDbankApiUrl + url
|
|
let apiUrl = urlList.includes(url) ? ajaxCommonUrl + url : ajaxDbankApiUrl + url
|
|
|
lk.log("apiUrl=" + apiUrl);
|
|
lk.log("apiUrl=" + apiUrl);
|
|
|
let finalHeaders = { 'Content-type': 'application/json;charset=UTF-8', ...headers };
|
|
let finalHeaders = { 'Content-type': 'application/json;charset=UTF-8', ...headers };
|
|
|
finalHeaders.Host = "merch.szx.abchina.com.cn";
|
|
finalHeaders.Host = "merch.szx.abchina.com.cn";
|
|
|
- lk.log("#########################7");
|
|
|
|
|
-
|
|
|
|
|
$task.fetch({
|
|
$task.fetch({
|
|
|
method: type,
|
|
method: type,
|
|
|
url: apiUrl,
|
|
url: apiUrl,
|
|
|
headers: finalHeaders,
|
|
headers: finalHeaders,
|
|
|
body: JSON.stringify(params),
|
|
body: JSON.stringify(params),
|
|
|
}).then(response => {
|
|
}).then(response => {
|
|
|
- console.log(response.statusCode + "\n\n" + response.body);
|
|
|
|
|
|
|
+ lk.log(response.statusCode + "\n\n" + response.body);
|
|
|
try {
|
|
try {
|
|
|
- let result = JSON.parse(data)
|
|
|
|
|
|
|
+ let result = JSON.parse(response.body)
|
|
|
//密文输出
|
|
//密文输出
|
|
|
if (result.enData) {
|
|
if (result.enData) {
|
|
|
let key = decryptRSA(result.aesKey);
|
|
let key = decryptRSA(result.aesKey);
|
|
@@ -438,7 +435,6 @@ async function wRequest(type = 'post', url, { data: data, headers: headers }) {
|
|
|
reject();
|
|
reject();
|
|
|
}
|
|
}
|
|
|
}, reason => {
|
|
}, reason => {
|
|
|
- console.log(reason.error);
|
|
|
|
|
lk.logErr(reason.error);
|
|
lk.logErr(reason.error);
|
|
|
lk.execFail();
|
|
lk.execFail();
|
|
|
reject();
|
|
reject();
|