using environment variable
This commit is contained in:
parent
ba66528512
commit
b097383e7f
31
daliy.js
31
daliy.js
@ -14,28 +14,13 @@ const headers = {
|
|||||||
'Referer': 'https://huodong3.3839.com/n/hykb/grow/daily.php',
|
'Referer': 'https://huodong3.3839.com/n/hykb/grow/daily.php',
|
||||||
'Accept-Encoding': 'gzip, deflate',
|
'Accept-Encoding': 'gzip, deflate',
|
||||||
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
|
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
|
||||||
'Cookie': 'UM_distinctid=188f5301bb07e-0b3fe772707e02-12155723-61ed0-188f5301bb16c; Hm_lvt_f1fb60d2559a83c8fa1ee6125a352bd7=1690692437; Hm_lpvt_f1fb60d2559a83c8fa1ee6125a352bd7=1691470971'
|
'Cookie': process.env.HYKB_COOKIE
|
||||||
};
|
};
|
||||||
const api = 'https://huodong3.3839.com/n/hykb/grow/ajax.php';
|
const api = 'https://huodong3.3839.com/n/hykb/grow/ajax.php';
|
||||||
const daily_list_api = 'https://huodong3.3839.com/n/hykb/grow/daily.php';
|
const daily_list_api = 'https://huodong3.3839.com/n/hykb/grow/daily.php';
|
||||||
|
|
||||||
const share_callback_action = 'DailyShareCallb';
|
const share_callback_action = 'DailyShareCallb';
|
||||||
const share_daily_action = 'DailyShare';
|
const share_daily_action = 'DailyShare';
|
||||||
// bbs.forEach((id,index) => {
|
|
||||||
// console.log("sign to bbsId => " + id);
|
|
||||||
// let data = qs.stringify({
|
|
||||||
// 'gameId': id
|
|
||||||
// });
|
|
||||||
// config['data'] = data;
|
|
||||||
|
|
||||||
// axios.request(config)
|
|
||||||
// .then((response) => {
|
|
||||||
// console.log(JSON.stringify(response.data));
|
|
||||||
// })
|
|
||||||
// .catch((error) => {
|
|
||||||
// console.log(error);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* random
|
* random
|
||||||
@ -57,8 +42,8 @@ function getApiData(action, id) {
|
|||||||
'id': id,
|
'id': id,
|
||||||
'mode': 'weixin',
|
'mode': 'weixin',
|
||||||
'r': generateRandom(),
|
'r': generateRandom(),
|
||||||
'scookie': '5|0|38524686|cmFpbmVyb3Npb24=|kb2318B047E13AB3BAC4C9E36B388B6260|7vcwpJVjplVWoJIUpl6xITZO7j9c7lIn7v7OGv6Aov6=%1|2f18a0f2283ce7f6804281632ccdef22',
|
'scookie': process.env.HYKB_SCOOKIE,
|
||||||
'device': 'kb2318B047E13AB3BAC4C9E36B388B6260'
|
'device': process.env.HYKB_DEVICE
|
||||||
});
|
});
|
||||||
let config = {
|
let config = {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@ -72,14 +57,14 @@ function getApiData(action, id) {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
// console.log(JSON.stringify(response.data));
|
// console.log(JSON.stringify(response.data));
|
||||||
let json_data = JSON.stringify(response.data);
|
let json_data = JSON.stringify(response.data);
|
||||||
if (action === share_callback_action && json_data && json_data['key'] === "501") {
|
if (action === share_callback_action && json_data && response.data['key'] === "501") {
|
||||||
config['data']['ac'] = share_daily_action;
|
config['data']['ac'] = share_daily_action;
|
||||||
axios.request(config)
|
axios.request(config)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let daily_json = JSON.stringify(res.data);
|
let daily_json = JSON.stringify(res.data);
|
||||||
if (daily_json && daily_json['key'] === "503") {
|
if (daily_json && res.data['key'] === "503") {
|
||||||
let csd = daily_json['reward_csd_num'];
|
let csd = res.data['reward_csd_num'];
|
||||||
let today_csd = daily_json['day_rw_csd'];
|
let today_csd = res.data['day_rw_csd'];
|
||||||
console.log("分享获得成熟度 " + csd + " 今日总共获取成熟度 " + today_csd);
|
console.log("分享获得成熟度 " + csd + " 今日总共获取成熟度 " + today_csd);
|
||||||
} else {
|
} else {
|
||||||
console.log(JSON.stringify(data));
|
console.log(JSON.stringify(data));
|
||||||
@ -97,7 +82,7 @@ function getApiData(action, id) {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
return json_data;
|
return null;
|
||||||
}
|
}
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
return new Promise(resolve => setTimeout(resolve, ms));
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user