forked from c29tZSBvbmU/LeishenAuto-fix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
52 lines (41 loc) · 1.33 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
md5 = require('js-md5');
const login = require("./api/auth").login;
const pause = require("./api/auth").pause;
const Secrets = {
username: process.env.LEISHEN_USERNAME,
password: md5(process.env.LEISHEN_PASSWORD)
}
function start(username, password) {
console.log('🌀雷神加速器暂停助手 开始运行-------')
if (!username) {
console.log("空用户名");
return;
}
if (!password) {
console.log("空密码");
return;
}
const user = {
account_token: null,
country_code: 86,
lang: "zh_CN",
password: Secrets.password,
region_code: 1,
src_channel: "guanwang",
user_type: "0",
username: Secrets.username
};
login(user).then(res => {
if (res.data.code == 0) {
let account_token = res.data.data.login_info.account_token;
pause({ "account_token": account_token, "lang": "zh_CN" }).then(res2 => {
console.log(res2.data.code + ':' + res2.data.msg);
console.log('🌀雷神加速器暂停助手 成功-------')
})
} else {
console.log('🌀雷神加速器暂停助手 失败-------')
}
console.log('🌀雷神加速器暂停助手 结束运行-------')
})
}
start(Secrets.username, Secrets.password);