(good)
| 321 | } |
| 322 | |
| 323 | function 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 | |
| 346 | async function tryGoodList() { |
| 347 | console.log(`⏰ 即将申请 ${$.goodList.length} 个商品`) |
no test coverage detected