Skip to content

Commit def8ec9

Browse files
committed
更新[京东618]: 增加加入品牌会员任务, 可能会自动加入品牌会员, 该任务可在 BoxJs 单独关闭
1 parent 2e6f2a0 commit def8ec9

3 files changed

Lines changed: 166 additions & 32 deletions

File tree

chavy.box.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ function getSystemApps() {
123123
name: '京东618',
124124
keys: ['chavy_url_jd816', 'chavy_body_jd816', 'chavy_headers_jd816'],
125125
settings: [
126-
{ id: 'CFG_618_isSignShop', name: '商店签到', val: true, type: 'boolean', desc: '71家商店, 如果每天都签不上, 可以关掉了! 默认: true' },
126+
{ id: 'CFG_618_isSignShop', name: '商店签到', val: true, type: 'boolean', desc: '71 家商店, 如果每天都签不上, 可以关掉了! 默认: true' },
127+
{ id: 'CFG_618_isJoinBrand', name: '品牌会员', val: true, type: 'boolean', desc: '25 个品牌, 会自动加入品牌会员! 默认: true' },
127128
{ id: 'CFG_BOOM_times_JD618', name: '炸弹次数', val: 1, type: 'text', desc: '总共发送多少次炸弹! 默认: 1' },
128129
{ id: 'CFG_BOOM_interval_JD618', name: '炸弹间隔 (毫秒)', val: 100, type: 'text', desc: '每次间隔多少毫秒! 默认: 100' }
129130
],
@@ -147,6 +148,14 @@ function getSystemApps() {
147148
repo: 'https://github.com/chavyleung/scripts/tree/master/v2ex',
148149
icon: 'https://raw.githubusercontent.com/Orz-3/mini/master/v2ex.png'
149150
},
151+
{
152+
id: 'WPS',
153+
name: 'WPS',
154+
keys: ['chavy_signhomeurl_wps', 'chavy_signhomeheader_wps', 'chavy_signwxurl_wps', 'chavy_signwxheader_wps'],
155+
author: '@chavyleung',
156+
repo: 'https://github.com/chavyleung/scripts/tree/master/wps',
157+
icon: 'https://is3-ssl.mzstatic.com/image/thumb/Purple123/v4/a0/15/bc/a015bcec-e853-cdb3-a97b-573c15771265/AppIcon-0-1x_U007emarketing-0-7-0-0-0-0-85-220.png/492x0w.png'
158+
},
150159
{
151160
id: 'NoteYoudao',
152161
name: '有道云笔记',

jd/jd.618.adapt.js

Lines changed: 83 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const $ = new Env('京东618')
22
$.VAL_url = $.getdata('chavy_url_jd816')
33
$.VAL_body = $.getdata('chavy_body_jd816')
44
$.VAL_headers = $.getdata('chavy_headers_jd816')
5+
$.VAL_isSignShop = $.getdata('CFG_618_isSignShop') || 'true'
6+
$.VAL_isJoinBrand = $.getdata('CFG_618_isJoinBrand') || 'true'
57

68
!(async () => {
79
$.log('', `🔔 ${$.name}, 开始!`, '')
@@ -50,7 +52,7 @@ function getShops() {
5052
const _shopact = {
5153
_raw: _shopa,
5254
id: _shopa.venderId,
53-
name: _shopa.name,
55+
name: _shopa.name
5456
}
5557
$.shopActs.push(_shopact)
5658
})
@@ -80,7 +82,8 @@ function getActs() {
8082
maxTimes: _a.maxTimes,
8183
waitDuration: _a.waitDuration === 0 ? 1 : _a.waitDuration,
8284
isProd: _a.productInfoVos ? true : false,
83-
tasks: [],
85+
isBrand: _a.shoppingActivityVos && _a.taskId === 42 ? true : false,
86+
tasks: []
8487
}
8588
const _vo = _a[Object.keys(_a).find((key) => (_a[key] && _a[key].itemId) || (_a[key] && _a[key][0] && _a[key][0].itemId))]
8689
if (Array.isArray(_vo)) {
@@ -114,7 +117,6 @@ async function execActs() {
114117
// 甄选优品
115118
else if (_act.isProd) {
116119
await getProdAct(_act)
117-
118120
for (let subactIdx = 0; subactIdx < _act.subacts.length; subactIdx++) {
119121
const subact = _act.subacts[subactIdx]
120122
$.log(` ${subactIdx + 1}. ${subact.name} (${subact.times}/${subact.maxTimes})`)
@@ -134,7 +136,23 @@ async function execActs() {
134136
$.log(` @完成任务: ${subatask.isExecSuc ? '🟢' : '🔴'}`, '')
135137
}
136138
}
137-
$.log('')
139+
}
140+
}
141+
// 开通会员
142+
else if (_act.isBrand) {
143+
if ($.VAL_isJoinBrand === 'true' || $.VAL_isJoinBrand === true) {
144+
for (let taskIdx = 0; taskIdx < _act.tasks.length; taskIdx++) {
145+
const task = _act.tasks[taskIdx]
146+
$.log(` ${taskIdx + 1}. ${task.name}`)
147+
await joinBrand(task)
148+
$.log(` @加入会员: ${task.isJoinSuc ? '🟢' : '🔴'}`)
149+
$.log(` @等待: ${_act.waitDuration} 秒`)
150+
await new Promise($.wait(_act.waitDuration * 1000))
151+
await brandAward(task)
152+
$.log(` @完成任务: ${task.isAwardSuc ? '🟢' : '🔴'}`, '')
153+
}
154+
} else {
155+
$.log(` @跳过: BoxJs 设置为 关闭 品牌会员!`, '')
138156
}
139157
}
140158
// 普通任务
@@ -155,21 +173,23 @@ async function execActs() {
155173
$.log(` @完成任务: ${task.isExecSuc ? '🟢' : '🔴'}`, '')
156174
}
157175
}
158-
$.log('')
159176
}
160-
$.log('')
161177
}
162178

163179
// 商店签到
164180
$.log(` ${$.acts.length + 1}. 商店签到 (${$.shopActs.length})`)
165-
for (let _shopIdx = 0; _shopIdx < $.shopActs.length; _shopIdx++) {
166-
const shop = $.shopActs[_shopIdx]
167-
$.log(` ${_shopIdx + 1}. ${shop.name}`)
168-
await signshop(shop)
169-
shop.msg = /,/.test(shop.msg) ? shop.msg.split(',')[1] : shop.msg
170-
$.log(` @签到: ${shop.isSuc ? '🟢 已领取!' : shop.code === 402 ? '⚪️ 无效活动!' : `🔴 ${shop.msg}`}`)
171-
$.log(` @等待: 1 秒`, '')
172-
await new Promise($.wait(1000))
181+
if ($.VAL_isSignShop === 'true' || $.VAL_isSignShop === true) {
182+
for (let _shopIdx = 0; _shopIdx < $.shopActs.length; _shopIdx++) {
183+
const shop = $.shopActs[_shopIdx]
184+
$.log(` ${_shopIdx + 1}. ${shop.name}`)
185+
await signshop(shop)
186+
shop.msg = /,/.test(shop.msg) ? shop.msg.split(',')[1] : shop.msg
187+
$.log(` @签到: ${shop.isSuc ? '🟢 已领取!' : shop.code === 402 ? '⚪️ 无效活动!' : `🔴 ${shop.msg}`}`)
188+
$.log(` @等待: 1 秒`, '')
189+
await new Promise($.wait(1000))
190+
}
191+
} else {
192+
$.log(` @跳过: BoxJs 设置为 关闭 商店签到!`, '')
173193
}
174194
}
175195

@@ -191,14 +211,14 @@ function getProdAct(act) {
191211
maxTimes: _suba.maxTimes,
192212
waitDuration: _suba.waitDuration === 0 ? 1 : _suba.waitDuration,
193213
isProd: _suba.productInfoVos ? true : false,
194-
tasks: [],
214+
tasks: []
195215
}
196216
_suba.productInfoVos.slice(0, 5).forEach((_prodvo) => {
197217
const _taskname = _prodvo.skuName || _prodvo.title || _prodvo.shopName || _prodvo.taskName || '未知名称'
198218
_subact.tasks.push({
199219
_raw: _prodvo,
200220
id: _prodvo.itemId,
201-
name: _taskname,
221+
name: _taskname
202222
})
203223
})
204224
act.subacts.push(_subact)
@@ -218,7 +238,7 @@ function sendtask(act, task, isClaim = false) {
218238
taskId: act.id,
219239
itemId: task.id,
220240
actionType: isClaim ? 1 : undefined,
221-
safeStr: JSON.stringify({ secretp: $.secretp }),
241+
safeStr: JSON.stringify({ secretp: $.secretp })
222242
}
223243

224244
$.post(taskurl('cakebaker_ckCollectScore', JSON.stringify(body)), (error, response, data) => {
@@ -262,6 +282,51 @@ function signshop(shop) {
262282
})
263283
}
264284

285+
function joinBrand(task) {
286+
return new Promise((resove) => {
287+
const body = {
288+
venderId: task._raw.copy1,
289+
shopId: task._raw.copy1,
290+
bindByVerifyCodeFlag: 1,
291+
registerExtend: {},
292+
writeChildFlag: 0,
293+
channel: 4032
294+
}
295+
const joinurl = `https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body=${encodeURIComponent(JSON.stringify(body))}&client=H5&clientVersion=8.5.6&uuid=88888`
296+
const url = { url: joinurl, headers: JSON.parse($.VAL_headers) }
297+
$.get(url, (error, response, data) => {
298+
try {
299+
const _data = JSON.parse(data)
300+
task.isJoinSuc = _data.busiCode === '0'
301+
task.msg = _data.message || '无'
302+
} catch (e) {
303+
task.isJoinSuc = false
304+
task.msg = error || e
305+
} finally {
306+
resove()
307+
}
308+
})
309+
})
310+
}
311+
function brandAward(task) {
312+
return new Promise((resove) => {
313+
const body = { venderId: task._raw.copy1, itemId: task.id }
314+
$.post(taskurl('cakebaker_taskBigBrandAward', JSON.stringify(body)), (error, response, data) => {
315+
try {
316+
const _data = JSON.parse(data)
317+
const _issuc = _data.data.bizCode === 0 || _data.data.bizCode === -5 || _data.data.bizCode === -15
318+
task.isAwardSuc = _issuc
319+
task.msg = _data.data.bizMsg || '无'
320+
} catch (e) {
321+
task.isAwardSuc = false
322+
task.msg = error || e
323+
} finally {
324+
resove()
325+
}
326+
})
327+
})
328+
}
329+
265330
function taskurl(fid, body = '{}') {
266331
const url = { url: `https://api.m.jd.com/client.action` }
267332
url.headers = JSON.parse($.VAL_headers)
@@ -272,4 +337,4 @@ function taskurl(fid, body = '{}') {
272337
function showmsg() {}
273338

274339
// prettier-ignore
275-
function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i),this.log("==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),t&&this.log(t),s&&this.log(s),i&&this.log(i)}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s.body=e,s.statusCode=s.status,i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))}
340+
function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i),this.log("==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),t&&this.log(t),s&&this.log(s),i&&this.log(i)}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s&&(s.body=e,s.statusCode=s.status),i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))}

jd/jd.618.js

Lines changed: 73 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ $.VAL_url = $.getdata('chavy_url_jd816')
33
$.VAL_body = $.getdata('chavy_body_jd816')
44
$.VAL_headers = $.getdata('chavy_headers_jd816')
55
$.VAL_isSignShop = $.getdata('CFG_618_isSignShop') || 'true'
6+
$.VAL_isJoinBrand = $.getdata('CFG_618_isJoinBrand') || 'true'
67

78
!(async () => {
89
$.log('', `🔔 ${$.name}, 开始!`, '')
@@ -24,13 +25,13 @@ function getData() {
2425
$.post(taskurl('cakebaker_getHomeData'), (error, response, data) => {
2526
try {
2627
if (error) throw new Error(error)
27-
const _info = JSON.parse(data).data?.result?.cakeBakerInfo
28-
$.secretp = _info?.secretp
28+
const _info = JSON.parse(data).data.result.cakeBakerInfo
29+
$.secretp = _info.secretp
2930
if (!$.secretp) throw new Error('获取 secretp 失败!')
3031
$.log(`❕ ${$.name}, 获取密钥!`)
3132
$.log(` 密钥 = ${$.secretp.slice(0, 10)}...`)
32-
$.log(` 等级 = ${_info?.raiseInfo?.scoreLevel}`)
33-
$.log(` 分数 = ${_info?.raiseInfo?.totalScore} => ${_info?.raiseInfo?.nextLevelScore}`, '')
33+
$.log(` 等级 = ${_info.raiseInfo.scoreLevel}`)
34+
$.log(` 分数 = ${_info.raiseInfo.totalScore} => ${_info.raiseInfo.nextLevelScore}`, '')
3435
} catch (e) {
3536
$.log(`❗️ ${$.name}, 获取密钥!`, ` error = ${error || e}`, `response = ${JSON.stringify(response)}`, `data = ${data}`, '')
3637
} finally {
@@ -72,7 +73,7 @@ function getActs() {
7273
$.log(`❕ ${$.name}, 获取活动!`)
7374
if (error) throw new Error(error)
7475
$.acts = []
75-
JSON.parse(data)?.data?.result?.taskVos.forEach((_a) => {
76+
JSON.parse(data).data.result.taskVos.forEach((_a) => {
7677
const _act = {
7778
_raw: _a,
7879
id: _a.taskId,
@@ -81,9 +82,10 @@ function getActs() {
8182
maxTimes: _a.maxTimes,
8283
waitDuration: _a.waitDuration === 0 ? 1 : _a.waitDuration,
8384
isProd: _a.productInfoVos ? true : false,
85+
isBrand: _a.shoppingActivityVos && _a.taskId === 42 ? true : false,
8486
tasks: []
8587
}
86-
const _vo = _a[Object.keys(_a).find((key) => _a[key]?.itemId || _a[key][0]?.itemId)]
88+
const _vo = _a[Object.keys(_a).find((key) => (_a[key] && _a[key].itemId) || (_a[key] && _a[key][0] && _a[key][0].itemId))]
8789
if (Array.isArray(_vo)) {
8890
_vo.forEach((_task) => _act.tasks.push({ _raw: _task, id: _task.itemId, name: _task.title || _task.shopName || _task.taskName || '未知名称' }))
8991
} else {
@@ -115,7 +117,6 @@ async function execActs() {
115117
// 甄选优品
116118
else if (_act.isProd) {
117119
await getProdAct(_act)
118-
119120
for (let subactIdx = 0; subactIdx < _act.subacts.length; subactIdx++) {
120121
const subact = _act.subacts[subactIdx]
121122
$.log(` ${subactIdx + 1}. ${subact.name} (${subact.times}/${subact.maxTimes})`)
@@ -135,7 +136,23 @@ async function execActs() {
135136
$.log(` @完成任务: ${subatask.isExecSuc ? '🟢' : '🔴'}`, '')
136137
}
137138
}
138-
$.log('')
139+
}
140+
}
141+
// 开通会员
142+
else if (_act.isBrand) {
143+
if ($.VAL_isJoinBrand === 'true' || $.VAL_isJoinBrand === true) {
144+
for (let taskIdx = 0; taskIdx < _act.tasks.length; taskIdx++) {
145+
const task = _act.tasks[taskIdx]
146+
$.log(` ${taskIdx + 1}. ${task.name}`)
147+
await joinBrand(task)
148+
$.log(` @加入会员: ${task.isJoinSuc ? '🟢' : '🔴'}`)
149+
$.log(` @等待: ${_act.waitDuration} 秒`)
150+
await new Promise($.wait(_act.waitDuration * 1000))
151+
await brandAward(task)
152+
$.log(` @完成任务: ${task.isAwardSuc ? '🟢' : '🔴'}`, '')
153+
}
154+
} else {
155+
$.log(` @跳过: BoxJs 设置为 关闭 品牌会员!`, '')
139156
}
140157
}
141158
// 普通任务
@@ -156,9 +173,7 @@ async function execActs() {
156173
$.log(` @完成任务: ${task.isExecSuc ? '🟢' : '🔴'}`, '')
157174
}
158175
}
159-
$.log('')
160176
}
161-
$.log('')
162177
}
163178

164179
// 商店签到
@@ -184,8 +199,8 @@ function getProdAct(act) {
184199
const body = { taskIds: act.tasks.map((task) => task.id).toString() }
185200
$.post(taskurl('cakebaker_getFeedDetail', JSON.stringify(body)), (error, response, data) => {
186201
try {
187-
const _result = JSON.parse(data)?.data?.result
188-
const _vo = _result[Object.keys(_result).find((key) => Array.isArray(_result[key]?.[0]?.productInfoVos))]
202+
const _result = JSON.parse(data).data.result
203+
const _vo = _result[Object.keys(_result).find((key) => Array.isArray(_result[key] && _result[key][0] && _result[key][0].productInfoVos))]
189204
act.subacts = []
190205
_vo.forEach((_suba) => {
191206
const _subact = {
@@ -267,6 +282,51 @@ function signshop(shop) {
267282
})
268283
}
269284

285+
function joinBrand(task) {
286+
return new Promise((resove) => {
287+
const body = {
288+
venderId: task._raw.copy1,
289+
shopId: task._raw.copy1,
290+
bindByVerifyCodeFlag: 1,
291+
registerExtend: {},
292+
writeChildFlag: 0,
293+
channel: 4032
294+
}
295+
const joinurl = `https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body=${encodeURIComponent(JSON.stringify(body))}&client=H5&clientVersion=8.5.6&uuid=88888`
296+
const url = { url: joinurl, headers: JSON.parse($.VAL_headers) }
297+
$.get(url, (error, response, data) => {
298+
try {
299+
const _data = JSON.parse(data)
300+
task.isJoinSuc = _data.busiCode === '0'
301+
task.msg = _data.message || '无'
302+
} catch (e) {
303+
task.isJoinSuc = false
304+
task.msg = error || e
305+
} finally {
306+
resove()
307+
}
308+
})
309+
})
310+
}
311+
function brandAward(task) {
312+
return new Promise((resove) => {
313+
const body = { venderId: task._raw.copy1, itemId: task.id }
314+
$.post(taskurl('cakebaker_taskBigBrandAward', JSON.stringify(body)), (error, response, data) => {
315+
try {
316+
const _data = JSON.parse(data)
317+
const _issuc = _data.data.bizCode === 0 || _data.data.bizCode === -5 || _data.data.bizCode === -15
318+
task.isAwardSuc = _issuc
319+
task.msg = _data.data.bizMsg || '无'
320+
} catch (e) {
321+
task.isAwardSuc = false
322+
task.msg = error || e
323+
} finally {
324+
resove()
325+
}
326+
})
327+
})
328+
}
329+
270330
function taskurl(fid, body = '{}') {
271331
const url = { url: `https://api.m.jd.com/client.action` }
272332
url.headers = JSON.parse($.VAL_headers)
@@ -277,4 +337,4 @@ function taskurl(fid, body = '{}') {
277337
function showmsg() {}
278338

279339
// prettier-ignore
280-
function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i),this.log("==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),t&&this.log(t),s&&this.log(s),i&&this.log(i)}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s.body=e,s.statusCode=s.status,i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))}
340+
function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i),this.log("==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),t&&this.log(t),s&&this.log(s),i&&this.log(i)}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s&&(s.body=e,s.statusCode=s.status),i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))}

0 commit comments

Comments
 (0)