forked from himcs/LeishenAuto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
48 lines (37 loc) · 1.28 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
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 || !password) {
console.log("Empty username or password");
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);