forked from Wenmoux/checkbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssly.js
32 lines (31 loc) · 1.1 KB
/
ssly.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
const axios = require("axios");
const CryptoJS = require("crypto-js");
//绅士领域 注册时候推荐码填:2984317
uid = config.ssly.uid; //抓包看,比如签到的post包里就有u_id,如120487
function ssly() {
return new Promise(async (resolve) => {
try {
let url = `https://sslyapp.site/mz_pbl/app_con/add_sign.php`;
let timestamp = Math.floor((new Date()).getTime()/1000)+"";
timestamp = timestamp.replace(/^\s+|\s+$/g,"");
let mac = CryptoJS.MD5(CryptoJS.SHA1(CryptoJS.MD5(timestamp).toString()).toString()).toString();
let data = `time=${timestamp}&mac=${mac}&u_id=${uid}`;
let res = await axios.post(url, data);
if (res.data.state == 0) {
msg = res.data.erro;
} else if (res.data.state == 1) {
msg = res.data.sms;
} else {
console.log(res.data);
msg = "签到失败,原因未知";
}
console.log(msg);
} catch (err) {
console.log(err);
msg = "签到接口请求失败";
}
resolve("【绅士领域】:" + msg);
});
}
//ssly()
module.exports = ssly;