mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
49735986d4
commit
1d6f4efe97
277
jd_dpqd.js
277
jd_dpqd.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
271
jd_try.js
271
jd_try.js
@ -1,16 +1,16 @@
|
|||||||
/*
|
/*
|
||||||
* 2022-07-20 修复获取试用列表风控问题;
|
|
||||||
* 2022-08-12 修复申请试用风控,更换nolan接口
|
* 2022-08-12 修复申请试用风控,更换nolan接口
|
||||||
* 2022-9-5 某个商品timeout继续下一个不中断
|
* 如需运行请自行添加环境变量:JD_TRY,值填 true 即可运行
|
||||||
* By https://github.com/6dylan6/jdpro/
|
* 上一作者说了每天最多300个商店,总上限为500个,jd_unsubscribe.js我已更新为批量取关版
|
||||||
* 基于X1a0He版本修改
|
* 请提前取关至少250个商店确保京东试用脚本正常运行
|
||||||
* @Address: https://github.com/X1a0He/jd_scripts_fixed/blob/main/jd_try_xh.js
|
|
||||||
|
|
||||||
|
如需运行请自行添加环境变量:JD_TRY="true" 即可运行
|
||||||
脚本是否耗时只看args_xh.maxLength的大小(申请数量),默认50个,申请100个差不多15分钟
|
脚本是否耗时只看args_xh.maxLength的大小(申请数量),默认50个,申请100个差不多15分钟
|
||||||
上一作者说每天申请上限300个(自测,没有申请过上限),关注店铺上限500个
|
上一作者说每天申请上限300个(自测,没有申请过上限),关注店铺上限500个
|
||||||
关注店铺满了就无法继续申请,可用批量取关店铺取消关注
|
关注店铺满了就无法继续申请,可用批量取关店铺取消关注
|
||||||
|
|
||||||
部分环境变量说明,详细请参考58行往下:
|
部分环境变量说明,详细请参考58行往下:
|
||||||
|
export JD_TRY="true"是否允许,默认false
|
||||||
export JD_TRY_PASSZC="false" #不过滤种草官类试用,默认true过滤
|
export JD_TRY_PASSZC="false" #不过滤种草官类试用,默认true过滤
|
||||||
export JD_TRY_MAXLENGTH="50" #商品数组的最大长度,默认50个
|
export JD_TRY_MAXLENGTH="50" #商品数组的最大长度,默认50个
|
||||||
export JD_TRY_PRICE="XX"#商品原价格,大于XX才申请,默认20
|
export JD_TRY_PRICE="XX"#商品原价格,大于XX才申请,默认20
|
||||||
@ -19,13 +19,13 @@ export JD_TRY_APPLYNUMFILTER="10000" #过滤大于设定值的已申请人数
|
|||||||
export JD_TRY_MINSUPPLYNUM="1" #最小提供数量
|
export JD_TRY_MINSUPPLYNUM="1" #最小提供数量
|
||||||
export JD_TRY_SENDNUM="10" #每隔多少账号发送一次通知,默认为4
|
export JD_TRY_SENDNUM="10" #每隔多少账号发送一次通知,默认为4
|
||||||
export JD_TRY_UNIFIED="false" 默认采用不同试用组
|
export JD_TRY_UNIFIED="false" 默认采用不同试用组
|
||||||
export JD_TRY_NUM="5" 最多跑多少个CK,默认10
|
export JD_TRY_NUM="7" 最多跑多少个CK,默认10
|
||||||
|
|
||||||
定时自定义,能用多久随缘了!!!
|
cron "1 1 1 1 1" jd_try.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const $ = new Env('京东试用')
|
const $ = new Env('京东试用')
|
||||||
const URL = 'https://api.m.jd.com/client.action'
|
const URL = 'https://api.m.jd.com/client.action'
|
||||||
|
|
||||||
let trialActivityIdList = []
|
let trialActivityIdList = []
|
||||||
let trialActivityTitleList = []
|
let trialActivityTitleList = []
|
||||||
let notifyMsg = ''
|
let notifyMsg = ''
|
||||||
@ -41,19 +41,18 @@ $.getNum = 0;
|
|||||||
$.try = true;
|
$.try = true;
|
||||||
$.sentNum = 0;
|
$.sentNum = 0;
|
||||||
$.cookiesArr = []
|
$.cookiesArr = []
|
||||||
//默认的过滤关键词
|
|
||||||
$.innerKeyWords =
|
$.innerKeyWords =
|
||||||
[
|
[
|
||||||
"幼儿园", "教程", "英语", "辅导", "培训",
|
"幼儿园", "教程", "英语", "辅导", "培训",
|
||||||
"孩子", "小学", "成人用品", "套套", "情趣",
|
"孩子", "小学", "成人用品", "套套", "情趣",
|
||||||
"自慰", "阳具", "飞机杯", "男士用品", "女士用品",
|
"自慰", "阳具", "飞机杯", "男士用品", "女士用品",
|
||||||
"内衣", "高潮", "避孕", "乳腺", "肛塞", "肛门",
|
"内衣", "高潮", "避孕", "乳腺", "肛塞", "肛门",
|
||||||
"宝宝", "芭比", "娃娃", "男用",
|
"宝宝", "玩具", "芭比", "娃娃", "男用",
|
||||||
"女用", "神油", "足力健", "老年", "老人",
|
"女用", "神油", "足力健", "老年", "老人",
|
||||||
"宠物", "饲料", "丝袜", "黑丝", "磨脚",
|
"宠物", "饲料", "丝袜", "黑丝", "磨脚",
|
||||||
"脚皮", "除臭", "性感", "内裤", "跳蛋",
|
"脚皮", "除臭", "性感", "内裤", "跳蛋",
|
||||||
"安全套", "龟头", "阴道", "阴部", "手机卡", "电话卡", "流量卡",
|
"安全套", "龟头", "阴道", "阴部", "手机卡", "电话卡", "流量卡",
|
||||||
"习题", "试卷",
|
"玉坠","和田玉","习题","试卷","手机壳","钢化膜"
|
||||||
]
|
]
|
||||||
//下面很重要,遇到问题请把下面注释看一遍再来问
|
//下面很重要,遇到问题请把下面注释看一遍再来问
|
||||||
let args_xh = {
|
let args_xh = {
|
||||||
@ -188,114 +187,113 @@ let args_xh = {
|
|||||||
!(async () => {
|
!(async () => {
|
||||||
await $.wait(500)
|
await $.wait(500)
|
||||||
// 如果你要运行京东试用这个脚本,麻烦你把环境变量 JD_TRY 设置为 true
|
// 如果你要运行京东试用这个脚本,麻烦你把环境变量 JD_TRY 设置为 true
|
||||||
if (process.env.JD_TRY && process.env.JD_TRY === 'true') {
|
if (1) {
|
||||||
$.log('\n遇到问题请先看脚本内注释;解决不了可联系https://t.me/dylan_jdpro\n');
|
await requireConfig()
|
||||||
await requireConfig()
|
if (!$.cookiesArr[0]) {
|
||||||
if (!$.cookiesArr[0]) {
|
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
|
||||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
|
"open-url": "https://bean.m.jd.com/"
|
||||||
"open-url": "https://bean.m.jd.com/"
|
})
|
||||||
})
|
return
|
||||||
return
|
}
|
||||||
}
|
args_xh.tabId = args_xh.tabId.sort(() => 0.5 - Math.random())
|
||||||
args_xh.tabId = args_xh.tabId.sort(() => 0.5 - Math.random())
|
for (let i = 0; i < args_xh.try_num; i++) {
|
||||||
for (let i = 0; i < args_xh.try_num; i++) {
|
if ($.cookiesArr[i]) {
|
||||||
if ($.cookiesArr[i]) {
|
$.cookie = $.cookiesArr[i];
|
||||||
$.cookie = $.cookiesArr[i];
|
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=(.+?);/) && $.cookie.match(/pt_pin=(.+?);/)[1])
|
||||||
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=(.+?);/) && $.cookie.match(/pt_pin=(.+?);/)[1])
|
$.index = i + 1;
|
||||||
$.index = i + 1;
|
$.isLogin = true;
|
||||||
$.isLogin = true;
|
$.nickName = '';
|
||||||
$.nickName = '';
|
//await totalBean();
|
||||||
await totalBean();
|
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
|
||||||
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
|
$.except = false;
|
||||||
$.except = false;
|
if(args_xh.except.includes($.UserName)){
|
||||||
if (args_xh.except.includes($.UserName)) {
|
console.log(`跳过账号:${$.nickName || $.UserName}`)
|
||||||
console.log(`跳过账号:${$.nickName || $.UserName}`)
|
$.except = true;
|
||||||
$.except = true;
|
continue
|
||||||
continue
|
}
|
||||||
}
|
if(!$.isLogin){
|
||||||
if (!$.isLogin) {
|
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
|
||||||
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
|
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||||
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
});
|
||||||
});
|
await $.notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
||||||
await $.notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
continue
|
||||||
continue
|
}
|
||||||
}
|
$.totalTry = 0
|
||||||
$.totalTry = 0
|
$.totalSuccess = 0
|
||||||
$.totalSuccess = 0
|
$.nowTabIdIndex = 0;
|
||||||
$.nowTabIdIndex = 0;
|
$.nowPage = 1;
|
||||||
$.nowPage = 1;
|
$.nowItem = 1;
|
||||||
$.nowItem = 1;
|
$.retrynum = 0
|
||||||
$.retrynum = 0
|
$.jda='__jda='+_jda('1xxxxxxxx.164xxxxxxxxxxxxxxxxxxx.164xxxxxxx.165xxxxxx.165xxxxxx.1xx')
|
||||||
$.jda = '__jda=' + _jda('1xxxxxxxx.164xxxxxxxxxxxxxxxxxxx.164xxxxxxx.165xxxxxx.165xxxxxx.1xx')
|
if (!args_xh.unified) {
|
||||||
if (!args_xh.unified) {
|
trialActivityIdList = []
|
||||||
trialActivityIdList = []
|
trialActivityTitleList = []
|
||||||
trialActivityTitleList = []
|
}
|
||||||
}
|
$.isLimit = false;
|
||||||
$.isLimit = false;
|
// 获取tabList的,不知道有哪些的把这里的注释解开跑一遍就行了
|
||||||
// 获取tabList的,不知道有哪些的把这里的注释解开跑一遍就行了
|
//await try_tabList();
|
||||||
//await try_tabList();
|
// return;
|
||||||
// return;
|
$.isForbidden = false
|
||||||
$.isForbidden = false
|
$.wrong = false
|
||||||
$.wrong = false
|
size = 1
|
||||||
size = 1
|
|
||||||
|
|
||||||
while (trialActivityIdList.length < args_xh.maxLength && $.retrynum < 3) {
|
while (trialActivityIdList.length < args_xh.maxLength && $.retrynum < 3) {
|
||||||
if ($.nowTabIdIndex === args_xh.tabId.length) {
|
if ($.nowTabIdIndex === args_xh.tabId.length) {
|
||||||
console.log(`tabId组已遍历完毕,不在获取商品\n`);
|
console.log(`tabId组已遍历完毕,不在获取商品\n`);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
await try_feedsList(args_xh.tabId[$.nowTabIdIndex], $.nowPage) //获取对应tabId的试用页面
|
await try_feedsList(args_xh.tabId[$.nowTabIdIndex], $.nowPage) //获取对应tabId的试用页面
|
||||||
|
}
|
||||||
|
if (trialActivityIdList.length < args_xh.maxLength) {
|
||||||
|
console.log(`间隔等待中,请等待3秒 \n`)
|
||||||
|
await $.wait(3000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (trialActivityIdList.length < args_xh.maxLength) {
|
if ($.isForbidden === false && $.isLimit === false) {
|
||||||
console.log(`间隔等待中,请等待3秒 \n`)
|
console.log(`稍后将执行试用申请,请等待 2 秒\n`)
|
||||||
await $.wait(3000);
|
await $.wait(2000);
|
||||||
|
for (let i = 0; i < trialActivityIdList.length && $.isLimit === false; i++) {
|
||||||
|
if ($.isLimit) {
|
||||||
|
console.log("试用上限")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if ($.isForbidden) { console.log('403了,跳出'); break }
|
||||||
|
await try_apply(trialActivityTitleList[i], trialActivityIdList[i])
|
||||||
|
//console.log(`间隔等待中,请等待 ${args_xh.applyInterval} ms\n`)
|
||||||
|
const waitTime = generateRandomInteger(args_xh.applyInterval, 9000);
|
||||||
|
console.log(`随机等待${waitTime}ms后继续`);
|
||||||
|
await $.wait(waitTime);
|
||||||
|
}
|
||||||
|
console.log("试用申请执行完毕...")
|
||||||
|
// await try_MyTrials(1, 1) //申请中的商品
|
||||||
|
$.giveupNum = 0;
|
||||||
|
$.successNum = 0;
|
||||||
|
$.getNum = 0;
|
||||||
|
$.completeNum = 0;
|
||||||
|
await try_MyTrials(1, 2) //申请成功的商品
|
||||||
|
// await try_MyTrials(1, 3) //申请失败的商品
|
||||||
|
await showMsg()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($.isForbidden === false && $.isLimit === false) {
|
if ($.isNode()) {
|
||||||
console.log(`稍后将执行试用申请,请等待 2 秒\n`)
|
if ($.index % args_xh.sendNum === 0) {
|
||||||
await $.wait(2000);
|
$.sentNum++;
|
||||||
for (let i = 0; i < trialActivityIdList.length && $.isLimit === false; i++) {
|
console.log(`正在进行第 ${$.sentNum} 次发送通知,发送数量:${args_xh.sendNum}`)
|
||||||
if ($.isLimit) {
|
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
||||||
console.log("试用上限");
|
notifyMsg = "";
|
||||||
break
|
|
||||||
}
|
|
||||||
if ($.isForbidden) { console.log('403了,跳出'); break };
|
|
||||||
await try_apply(trialActivityTitleList[i], trialActivityIdList[i]);
|
|
||||||
//console.log(`间隔等待中,请等待 ${args_xh.applyInterval} ms\n`)
|
|
||||||
const waitTime = generateRandomInteger(args_xh.applyInterval, 9000);
|
|
||||||
console.log(`随机等待${waitTime}ms后继续`);
|
|
||||||
await $.wait(waitTime);
|
|
||||||
}
|
}
|
||||||
console.log("试用申请执行完毕...")
|
|
||||||
// await try_MyTrials(1, 1) //申请中的商品
|
|
||||||
$.giveupNum = 0;
|
|
||||||
$.successNum = 0;
|
|
||||||
$.getNum = 0;
|
|
||||||
$.completeNum = 0;
|
|
||||||
await try_MyTrials(1, 2) //申请成功的商品
|
|
||||||
// await try_MyTrials(1, 3) //申请失败的商品
|
|
||||||
await showMsg()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($.isNode()) {
|
if ($.isNode() && $.except === false) {
|
||||||
if ($.index % args_xh.sendNum === 0) {
|
if (($.cookiesArr.length - ($.sentNum * args_xh.sendNum)) < args_xh.sendNum && notifyMsg.length != 0) {
|
||||||
$.sentNum++;
|
console.log(`正在进行最后一次发送通知,发送数量:${($.cookiesArr.length - ($.sentNum * args_xh.sendNum))}`)
|
||||||
console.log(`正在进行第 ${$.sentNum} 次发送通知,发送数量:${args_xh.sendNum}`)
|
|
||||||
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
||||||
notifyMsg = "";
|
notifyMsg = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($.isNode() && $.except === false) {
|
|
||||||
if (($.cookiesArr.length - ($.sentNum * args_xh.sendNum)) < args_xh.sendNum && notifyMsg.length != 0) {
|
|
||||||
console.log(`正在进行最后一次发送通知,发送数量:${($.cookiesArr.length - ($.sentNum * args_xh.sendNum))}`)
|
|
||||||
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
|
||||||
notifyMsg = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`\n您未设置变量export JD_TRY="true"运行【京东试用】脚本, 结束运行!\n`)
|
console.log(`\n您未设置变量export JD_TRY="true"运行【京东试用】脚本, 结束运行!\n`)
|
||||||
}
|
}
|
||||||
})().catch((e) => {
|
})().catch((e) => {
|
||||||
console.error(`❗️ ${$.name} 运行错误!\n${e}`)
|
console.error(`❗️ ${$.name} 运行错误!\n${e}`)
|
||||||
}).finally(() => $.done())
|
}).finally(() => $.done())
|
||||||
@ -499,31 +497,31 @@ function try_feedsList(tabId, page) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function try_apply(title, activityId) {
|
function try_apply(title, activityId) {
|
||||||
console.log(`申请试用商品提交中...`)
|
|
||||||
args_xh.printLog ? console.log(`商品:${title}`) : ''
|
|
||||||
args_xh.printLog ? console.log(`id为:${activityId}`) : ''
|
|
||||||
let body = JSON.stringify({
|
|
||||||
"activityId": activityId,
|
|
||||||
"previewTime": ""
|
|
||||||
});
|
|
||||||
body = await geth5st(body);
|
|
||||||
if(!body) return;
|
|
||||||
let opt =
|
|
||||||
{
|
|
||||||
"url": `${URL}?${body}}`,
|
|
||||||
'headers': {
|
|
||||||
'Cookie': $.cookie + $.jda,
|
|
||||||
'user-agent': 'jdapp;iPhone;10.1.2;15.0;ff2caa92a8529e4788a34b3d8d4df66d9573f499;network/wifi;model/iPhone13,4;addressid/2074196292;appBuild/167802;jdSupportDarkMode/1;Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
|
||||||
'Referer': 'https://prodev.m.jd.com/',
|
|
||||||
'origin': 'https://prodev.m.jd.com/',
|
|
||||||
'Accept': 'application/json,text/plain,*/*',
|
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
|
||||||
'Accept-Language': 'zh-cn',
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
|
console.log(`申请试用商品提交中...`)
|
||||||
|
args_xh.printLog ? console.log(`商品:${title}`) : ''
|
||||||
|
args_xh.printLog ? console.log(`id为:${activityId}`) : ''
|
||||||
|
let body = JSON.stringify({
|
||||||
|
"activityId": activityId,
|
||||||
|
"previewTime": ""
|
||||||
|
});
|
||||||
|
body = await geth5st(body);
|
||||||
|
if(!body) return;
|
||||||
|
let opt =
|
||||||
|
{
|
||||||
|
"url": `${URL}?${body}}`,
|
||||||
|
'headers': {
|
||||||
|
'Cookie': $.cookie + $.jda,
|
||||||
|
'user-agent': 'jdapp;iPhone;10.1.2;15.0;ff2caa92a8529e4788a34b3d8d4df66d9573f499;network/wifi;model/iPhone13,4;addressid/2074196292;appBuild/167802;jdSupportDarkMode/1;Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'Referer': 'https://prodev.m.jd.com/',
|
||||||
|
'origin': 'https://prodev.m.jd.com/',
|
||||||
|
'Accept': 'application/json,text/plain,*/*',
|
||||||
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
|
'Accept-Language': 'zh-cn',
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
}
|
||||||
$.get(opt, (err, resp, data) => {
|
$.get(opt, (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -724,7 +722,7 @@ function geth5st(body) {
|
|||||||
"functionId": "try_apply",
|
"functionId": "try_apply",
|
||||||
"body": body,
|
"body": body,
|
||||||
"appid": "newtry",
|
"appid": "newtry",
|
||||||
"client": "wh5",
|
"client": "wh5",
|
||||||
"clientVersion": "11.0.2",
|
"clientVersion": "11.0.2",
|
||||||
"ua": 'jdapp;iPhone;10.1.2;15.0;ff2caa92a8529e4788a34b3d8d4df66d9573f499;network/wifi;model/iPhone13,4;addressid/2074196292;appBuild/167802;jdSupportDarkMode/1;Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
"ua": 'jdapp;iPhone;10.1.2;15.0;ff2caa92a8529e4788a34b3d8d4df66d9573f499;network/wifi;model/iPhone13,4;addressid/2074196292;appBuild/167802;jdSupportDarkMode/1;Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
"pin": encodeURIComponent($.UserName)
|
"pin": encodeURIComponent($.UserName)
|
||||||
@ -732,20 +730,19 @@ function geth5st(body) {
|
|||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
},str='';
|
},str='';
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
$.post(opt, (err, resp, data) => {
|
$.post(opt, (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(JSON.stringify(err));
|
console.log(JSON.stringify(err));
|
||||||
console.log('连接服务失败\n');
|
|
||||||
} else {
|
} else {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
str = data.body;
|
str = data.body;
|
||||||
} else {
|
} else {
|
||||||
$.log('获取失败',data.msg);
|
$.log('连接服务失败',data.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -977,7 +974,7 @@ function Env(name, opts) {
|
|||||||
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || []
|
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || []
|
||||||
path.slice(0, -1).reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
path.slice(0, -1).reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
||||||
path[path.length - 1]
|
path[path.length - 1]
|
||||||
] = value
|
] = value
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1347,4 +1344,4 @@ function Env(name, opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})(name, opts)
|
})(name, opts)
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user