mirror of
https://github.com/lan-tianxiang/clone_scripts.git
synced 2026-03-30 05:38:34 +08:00
更新于 08-06 11:01
This commit is contained in:
@@ -61,7 +61,7 @@ if ($.isNode()) {
|
||||
let notifyContent = ''
|
||||
console.log = (...args) => {
|
||||
if(args[0].includes("【签到号")){
|
||||
notifyContent += args[0].split('\n\n')[1]
|
||||
notifyContent += args[0].split('\n\n')[1] + '\n'
|
||||
// originalLog('catch notifyContent:'+notifyContent)
|
||||
}
|
||||
originalLog.apply(
|
||||
@@ -108,37 +108,33 @@ function changeFile (content,cookie) {
|
||||
return newContent
|
||||
}
|
||||
|
||||
async function TotalBean(cookie) {
|
||||
function TotalBean(cookie) {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
|
||||
"headers": {
|
||||
"Accept": "application/json,text/plain, */*",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
|
||||
headers: {
|
||||
Host: "me-api.jd.com",
|
||||
Accept: "*/*",
|
||||
Connection: "keep-alive",
|
||||
Cookie: cookie,
|
||||
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
||||
"Accept-Language": "zh-cn",
|
||||
"Connection": "keep-alive",
|
||||
"Cookie": cookie,
|
||||
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
|
||||
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
|
||||
},
|
||||
"timeout": 10000
|
||||
"Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
|
||||
"Accept-Encoding": "gzip, deflate, br"
|
||||
}
|
||||
}
|
||||
$.post(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
resolve()
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
if (data['retcode'] === 13) {
|
||||
return //cookie过期
|
||||
}
|
||||
if (data['retcode'] === 0) {
|
||||
$.nickName = (data['base'] && data['base'].nickname) || $.UserName;
|
||||
} else {
|
||||
$.nickName = $.UserName
|
||||
if (data['retcode'] === "1001") {
|
||||
resolve(); //cookie过期
|
||||
return
|
||||
}
|
||||
resolve(true)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user