Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhinianboke committed Feb 25, 2024
1 parent ddb66c1 commit 3f6ce91
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 3 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
app:layout_constraintHorizontal_bias="0.465"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.469" />
app:layout_constraintVertical_bias="0.331" />

<EditText
android:id="@+id/editText2"
Expand All @@ -29,7 +29,7 @@
app:layout_constraintHorizontal_bias="0.465"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.58" />
app:layout_constraintVertical_bias="0.445" />

<ToggleButton
android:id="@+id/button"
Expand Down
102 changes: 102 additions & 0 deletions 青龙脚步/jdxq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
const fetch = require('node-fetch')


async function sleepAsync(time) { await sleep(time);}

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

const timer = ms => new Promise( res => setTimeout(res, ms));

// 变量,填写手机号,使用 @分割 例如:123@456
var phoneStr = "123@456";
var codeJiuxu = false;
var code = "";
main()
async function main() {
try{
var phoneArr = phoneStr.split("@");
for(var i=0;i<phoneArr.length;i++) {
var phone = phoneArr[i];
codeJiuxu = false;
code = "";
console.log(phone)
await sendCode(phone)

if(codeJiuxu) {
for(var j=0;j < 15;j++) {
if(code) {
break;
}
console.log(phone + "开始第"+(j+1)+"次获取验证码");
await sleepAsync(1500);
if(!code) {
await getCode(phone);
}
}
if(code) {
await loginJd(phone, code);
}
}

}
//
}
catch(e) {

}
}

async function sendCode(phone) {
console.log(phone + "开始发送验证码");
var response = await fetch("https://dy.zhinianboke.com/jd/sendCode?phone="+phone, {
"headers": {
},
"body": "",
"method": "post"
});
await response.json().then((data) => {
if(data.status == 200) {
codeJiuxu = true;
console.log(phone + "验证码发送成功");
}
else {
console.log(phone + data.message);
}
}).catch((err) => {
console.log(err);
})
}
async function getCode(phone) {
var response = await fetch("https://dy.zhinianboke.com/jd/getCode?phone="+phone, {
"headers": {
},
"body": "",
"method": "post"
});
await response.json().then((data) => {
if(data.status == 200) {
code = data.data;
console.log(phone + "获取的验证码为:" + code);
}
else {
console.log(phone + "本次未获得验证码");
}
}).catch((err) => {
console.log(err);
})
}
async function loginJd(phone,code) {
var response = await fetch("https://dy.zhinianboke.com/jd/loginJd?phone="+phone + "&code="+code, {
"headers": {
},
"body": "",
"method": "post"
});
await response.json().then((data) => {
console.log(phone + data.message);
}).catch((err) => {
console.log(err);
})
}

0 comments on commit 3f6ce91

Please sign in to comment.