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

Function helpFriend

jd_cash.js:206–234  ·  view source on GitHub ↗
(helpInfo)

Source from the content-addressed store, hash-verified

204 // }
205}
206function helpFriend(helpInfo) {
207 return new Promise((resolve) => {
208 $.get(taskUrl("cash_mob_assist", {...helpInfo,"source":1}), (err, resp, data) => {
209 try {
210 if (err) {
211 console.log(`${JSON.stringify(err)}`)
212 console.log(`${$.name} API请求失败,请检查网路重试`)
213 } else {
214 if (safeGet(data)) {
215 data = JSON.parse(data);
216 if( data.code === 0 && data.data.bizCode === 0){
217 console.log(`助力成功,获得${data.data.result.cashStr}`)
218 // console.log(data.data.result.taskInfos)
219 } else if (data.data.bizCode===207){
220 console.log(data.data.bizMsg)
221 $.canHelp = false
222 } else{
223 console.log(data.data.bizMsg)
224 }
225 }
226 }
227 } catch (e) {
228 $.logErr(e, resp)
229 } finally {
230 resolve(data);
231 }
232 })
233 })
234}
235function doTask(type,taskInfo) {
236 return new Promise((resolve) => {
237 $.get(taskUrl("cash_doTask",{"type":type,"taskInfo":taskInfo}), (err, resp, data) => {

Callers 1

helpFriendsFunction · 0.70

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected