MCPcopy Create free account
hub / github.com/chavyleung/scripts / getShops

Function getShops

jd/jd.618.js:47–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47function getShops() {
48 return new Promise((resove) => {
49 $.post(taskurl('cakebaker_bigBrandHomeData'), (error, response, data) => {
50 try {
51 $.log(`❕ ${$.name}, 获取商店!`)
52 if (error) throw new Error(error)
53 $.shopActs = []
54 JSON.parse(data).data.result.bigBrandList.forEach((_shopa) => {
55 const _shopact = {
56 _raw: _shopa,
57 id: _shopa.venderId,
58 name: _shopa.name
59 }
60 $.shopActs.push(_shopact)
61 })
62 $.log(` 商店数量 = ${$.shopActs.length}`, '')
63 } catch (e) {
64 $.log(`❗️ ${$.name}, 获取商店!`, ` error = ${error || e}`, `response = ${JSON.stringify(response)}`, `data = ${data}`, '')
65 } finally {
66 resove()
67 }
68 })
69 })
70}
71
72function getActs() {
73 return new Promise((resove) => {

Callers 1

jd.618.jsFile · 0.70

Calls 3

taskurlFunction · 0.70
postMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected