Revert "update"

This reverts commit aa7dc67716cdd9655a4452b78403465035189c97.
This commit is contained in:
lxk0301
2021-03-11 10:09:03 +08:00
parent 46d7bf20ac
commit 58c7f89c25
2 changed files with 21 additions and 24 deletions

View File

@ -115,7 +115,7 @@ if [ $ENABLE_AUTO_HELP = "true" ]; then
echo "开启自动助力"
#在所有脚本执行前,先执行助力码导出
sed -i 's/node/ . \/scripts\/docker\/auto_help.sh export >> \/scripts\/logs\/auto_help_export.log \&\& node /g' ${mergedListFile}
sed -i 's/node/ . \/scripts\/docker\/auto_help.sh export \&\& node /g' ${mergedListFile}
else
echo "未开启自动助力"
fi

View File

@ -141,46 +141,43 @@ async function bean() {
function TotalBean() {
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.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"),
"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.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0")
"Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
"Accept-Encoding": "gzip, deflate, br"
}
}
$.post(options, (err, resp, data) => {
$.get(options, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败请检查网路重试`)
$.logErr(err)
} else {
if (data) {
data = JSON.parse(data);
if (data['retcode'] === 13) {
if (data['retcode'] === "1001") {
$.isLogin = false; //cookie过期
return
return;
}
if (data['retcode'] === 0) {
$.nickName = (data['base'] && data['base'].nickname) || $.UserName;
} else {
$.nickName = $.UserName
if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
$.nickName = data.data.userInfo.baseInfo.nickname;
}
if (data['retcode'] === 0) {
$.beanCount = data['base'].jdNum;
if (data['retcode'] === '0' && data.data && data.data['assetInfo']) {
$.beanCount = data.data && data.data['assetInfo']['beanNum'];
}
} else {
console.log(`京东服务器返回空数据`)
$.log('京东服务器返回空数据');
}
}
} catch (e) {
$.logErr(e, resp)
$.logErr(e)
} finally {
resolve(data);
resolve();
}
})
})