fix
This commit is contained in:
20
jd_cash.js
20
jd_cash.js
@@ -291,7 +291,8 @@ function shareCodesFormat() {
|
||||
console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
|
||||
const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
|
||||
$.newShareCodes = inviteCodes[tempIndex].split('@');
|
||||
$.newShareCodes = [...($.authorCode.map((item, index) => $.authorCode[index] = item['inviteCode'])), ...$.newShareCodes];
|
||||
let authorCode = deepCopy($.authorCode)
|
||||
$.newShareCodes = [...(authorCode.map((item, index) => authorCode[index] = item['inviteCode'])), ...$.newShareCodes];
|
||||
}
|
||||
const readShareCodeRes = await readShareCode();
|
||||
if (readShareCodeRes && readShareCodeRes.code === 200) {
|
||||
@@ -329,6 +330,23 @@ function requireConfig() {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
function deepCopy(obj) {
|
||||
let objClone = Array.isArray(obj) ? [] : {};
|
||||
if (obj && typeof obj === "object") {
|
||||
for (let key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
//判断ojb子元素是否为对象,如果是,递归复制
|
||||
if (obj[key] && typeof obj[key] === "object") {
|
||||
objClone[key] = deepCopy(obj[key]);
|
||||
} else {
|
||||
//如果不是,简单复制
|
||||
objClone[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return objClone;
|
||||
}
|
||||
function taskUrl(functionId, body = {}) {
|
||||
return {
|
||||
url: `${JD_API_HOST}?functionId=${functionId}&body=${escape(JSON.stringify(body))}&appid=CashRewardMiniH5Env&appid=9.1.0`,
|
||||
|
Reference in New Issue
Block a user