增加收取美妆币功能
This commit is contained in:
34
jd_beauty.js
34
jd_beauty.js
@@ -64,7 +64,9 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
|||||||
if ($.accountCheck) {
|
if ($.accountCheck) {
|
||||||
await jdBeauty();
|
await jdBeauty();
|
||||||
}
|
}
|
||||||
if($.accountCheck){ helpInfo = $.helpInfo;}
|
if ($.accountCheck) {
|
||||||
|
helpInfo = $.helpInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
@@ -75,7 +77,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
|||||||
$.done();
|
$.done();
|
||||||
})
|
})
|
||||||
|
|
||||||
async function accountCheck(){
|
async function accountCheck() {
|
||||||
$.hasDone = false;
|
$.hasDone = false;
|
||||||
console.log(`***检测账号是否黑号***`);
|
console.log(`***检测账号是否黑号***`);
|
||||||
await getIsvToken()
|
await getIsvToken()
|
||||||
@@ -86,8 +88,8 @@ async function accountCheck(){
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let client = new WebSocket(`wss://xinruimz-isv.isvjcloud.com/wss/?token=${$.token}`,null,{
|
let client = new WebSocket(`wss://xinruimz-isv.isvjcloud.com/wss/?token=${$.token}`, null, {
|
||||||
headers:{
|
headers: {
|
||||||
'user-agent': "jdapp;android;9.5.0;5.1.1;8363331303230333330383934363-73D2138356239366237373730303;network/wifi;model/vivo X7;addressid/4092959325;aid/e3378926a846c4f7;oaid/;osVer/22;appBuild/87697;partner/vivo;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 5.1.1; vivo X7 Build/LMY47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
'user-agent': "jdapp;android;9.5.0;5.1.1;8363331303230333330383934363-73D2138356239366237373730303;network/wifi;model/vivo X7;addressid/4092959325;aid/e3378926a846c4f7;oaid/;osVer/22;appBuild/87697;partner/vivo;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 5.1.1; vivo X7 Build/LMY47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -98,22 +100,23 @@ async function accountCheck(){
|
|||||||
client.send(`{"msg":{"type":"action","args":{"source":1},"action":"get_user"}}`);
|
client.send(`{"msg":{"type":"action","args":{"source":1},"action":"get_user"}}`);
|
||||||
};
|
};
|
||||||
client.onmessage = async function (e) {
|
client.onmessage = async function (e) {
|
||||||
if(e.data !== 'pong' && e.data && safeGet(e.data)){
|
if (e.data !== 'pong' && e.data && safeGet(e.data)) {
|
||||||
let vo = JSON.parse(e.data);
|
let vo = JSON.parse(e.data);
|
||||||
if (vo.action === "_init_") {
|
if (vo.action === "_init_") {
|
||||||
let vo = JSON.parse(e.data);
|
let vo = JSON.parse(e.data);
|
||||||
if(vo.msg === "风险用户"){
|
if (vo.msg === "风险用户") {
|
||||||
$.accountCheck=false;
|
$.accountCheck = false;
|
||||||
// $.init=true;
|
// $.init=true;
|
||||||
client.close();
|
client.close();
|
||||||
console.log(`${vo.msg},跳过此账号`)};
|
console.log(`${vo.msg},跳过此账号`)
|
||||||
|
}
|
||||||
} else if (vo.action === "get_user") {
|
} else if (vo.action === "get_user") {
|
||||||
// $.init=true;
|
// $.init=true;
|
||||||
$.accountCheck=true;
|
$.accountCheck = true;
|
||||||
client.close();
|
client.close();
|
||||||
console.log(`${vo.msg},账号正常`);
|
console.log(`${vo.msg},账号正常`);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
client.onclose = (e) => {
|
client.onclose = (e) => {
|
||||||
$.hasDone = true;
|
$.hasDone = true;
|
||||||
// console.log(client.readyState);
|
// console.log(client.readyState);
|
||||||
@@ -160,7 +163,7 @@ async function mr() {
|
|||||||
client.send(`ping`)
|
client.send(`ping`)
|
||||||
await $.wait(1000)
|
await $.wait(1000)
|
||||||
}
|
}
|
||||||
console.log(helpInfo);
|
console.log('helpInfo', helpInfo);
|
||||||
for (let help of helpInfo) {
|
for (let help of helpInfo) {
|
||||||
client.send(help);
|
client.send(help);
|
||||||
}
|
}
|
||||||
@@ -192,6 +195,7 @@ async function mr() {
|
|||||||
await $.wait(1000)
|
await $.wait(1000)
|
||||||
// 获得福利中心
|
// 获得福利中心
|
||||||
client.send(`{"msg":{"type":"action","args":{},"action":"get_benefit"}}`)
|
client.send(`{"msg":{"type":"action","args":{},"action":"get_benefit"}}`)
|
||||||
|
client.send(`{"msg":{"type":"action","args":{},"action":"collect_coins"}}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
client.onclose = () => {
|
client.onclose = () => {
|
||||||
@@ -433,6 +437,14 @@ async function mr() {
|
|||||||
console.log(`生产信息获取失败,错误信息${vo.msg}`)
|
console.log(`生产信息获取失败,错误信息${vo.msg}`)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case "collect_coins":
|
||||||
|
if (vo.code === '200' || vo.code === 200) {
|
||||||
|
// console.log(`product_produce:${JSON.stringify(vo)}`)
|
||||||
|
console.log(`收取成功,获得${vo['data']['coins']}美妆币,当前总美妆币:${vo['data']['user_coins']}\n`)
|
||||||
|
} else {
|
||||||
|
console.log(`收取美妆币失败,错误信息${vo.msg}`)
|
||||||
|
}
|
||||||
|
break
|
||||||
case "product_producing":
|
case "product_producing":
|
||||||
if (vo.code === '200' || vo.code === 200) {
|
if (vo.code === '200' || vo.code === 200) {
|
||||||
for (let product of vo.data) {
|
for (let product of vo.data) {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const JD_API_HOST = 'https://api.m.jd.com/api';
|
|||||||
// console.log(nowTs, $.startTime, $.endTime)
|
// console.log(nowTs, $.startTime, $.endTime)
|
||||||
for (let id of $.newAcids) {
|
for (let id of $.newAcids) {
|
||||||
// $.activityId = id;
|
// $.activityId = id;
|
||||||
await receiveRedRain(id);
|
if (id) await receiveRedRain(id);
|
||||||
}
|
}
|
||||||
// await showMsg();
|
// await showMsg();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user