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

Function finishCard

jd_factory_component.js:323–340  ·  view source on GitHub ↗
({ cardId })

Source from the content-addressed store, hash-verified

321}
322
323function finishCard({ cardId }) {
324 return new Promise(async resolve => {
325 $.get(taskStroyUrl('userinfo/FinishCard', `cardid=${cardId}`), async (err, resp, data) => {
326 try {
327 const { ret, data: { cardInfo = [], earnRatio } = {}, msg } = JSON.parse(data);
328 $.log(`\n翻倍 ${msg},获得倍数 ${earnRatio || 0}`);
329 $.multiple += earnRatio;
330 if (ret === 0 && $.authExecute && earnRatio) {
331 await getReadyCard()
332 }
333 } catch (e) {
334 $.logErr(e, resp);
335 } finally {
336 resolve();
337 }
338 });
339 });
340}
341
342function showMsg() {
343 return new Promise(resolve => {

Callers 1

selectCardFunction · 0.70

Calls 5

taskStroyUrlFunction · 0.85
getReadyCardFunction · 0.85
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected