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

Function helpFriend

activity/jd_pubg.js:258–283  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

256 })
257}
258function helpFriend(code) {
259 let body = `shareId=${code}`
260 return new Promise(resolve => {
261 $.post(taskPostUrl(body,'doSupport'), async (err, resp, data) => {
262 try {
263 if (err) {
264 console.log(`${JSON.stringify(err)}`)
265 console.log(`${$.name} API请求失败,请检查网路重试`)
266 } else {
267 if (safeGet(data)) {
268 data = JSON.parse(data);
269 if(data.code === 200){
270 console.log(`助力好友 ${code} 成功`)
271 }else{
272 console.log(`助力好友 ${code} 失败, ${data.msg}`)
273 }
274 }
275 }
276 } catch (e) {
277 $.logErr(e, resp)
278 } finally {
279 resolve();
280 }
281 })
282 })
283}
284function doTask(body) {
285 return new Promise(resolve => {
286 $.post(taskPostUrl(body), async (err, resp, data) => {

Callers 1

helpFriendsFunction · 0.70

Calls 5

taskPostUrlFunction · 0.70
safeGetFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected