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

Function getShopList

activity/jd_tcl.js:211–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209}
210
211function getShopList() {
212 return new Promise((resolve) => {
213 $.post(taskUrl('/ql/front/tcl002/showshopload'), async (err, resp, data) => {
214 try {
215 if (err) {
216 console.log(`${JSON.stringify(err)}`);
217 console.log(`${$.name} API请求失败,请检查网路重试`);
218 } else {
219 data = $.toObj(data)
220 for (let vo of data.data) {
221 if (!vo.followFlag) {
222 await browseShop(vo.id)
223 await $.wait(1000)
224 }
225 }
226 }
227 } catch (e) {
228 $.logErr(e, resp);
229 } finally {
230 resolve(data);
231 }
232 });
233 });
234}
235
236function browseShop(shopId) {
237 return new Promise((resolve) => {

Callers 1

mainFunction · 0.70

Calls 7

taskUrlFunction · 0.70
browseShopFunction · 0.70
postMethod · 0.45
logMethod · 0.45
toObjMethod · 0.45
waitMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected