MCPcopy Create free account
hub / github.com/Semporia/Scripts / followShop

Function followShop

jd_try.js:323–344  ·  view source on GitHub ↗
(good)

Source from the content-addressed store, hash-verified

321}
322
323function followShop(good) {
324 return new Promise((resolve, reject) => {
325 $.get(taskurl(`${selfDomain}/followShop?id=${good.shopId}`, good.id), (err, resp, data) => {
326 try {
327 if (err) {
328 console.log(`🚫 ${arguments.callee.name.toString()} API请求失败,请检查网路\n${JSON.stringify(err)}`)
329 } else {
330 data = JSON.parse(data)
331 if (data.code == 'F0410') {
332 $.running = false
333 $.stopMsg = data.msg || "关注数超过上限了哦~先清理下关注列表吧"
334 }
335 resolve(data.success && data.data)
336 }
337 } catch (e) {
338 reject(`⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(data)}`)
339 } finally {
340 resolve(false)
341 }
342 })
343 })
344}
345
346async function tryGoodList() {
347 console.log(`⏰ 即将申请 ${$.goodList.length} 个商品`)

Callers 1

tryGoodListFunction · 0.70

Calls 3

taskurlFunction · 0.70
getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected