| 84 | }) |
| 85 | } |
| 86 | function userSignIn() { |
| 87 | return new Promise(resolve => { |
| 88 | $.post(taskUrl(), (err, resp, data) => { |
| 89 | try { |
| 90 | if (err) { |
| 91 | console.log(`${JSON.stringify(err)}`) |
| 92 | console.log(resp) |
| 93 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 94 | } else { |
| 95 | if (safeGet(data)) { |
| 96 | data = JSON.parse(data); |
| 97 | if (data.code === 1) { |
| 98 | console.log(`今日签到成功,获得${data.content[0].title}`) |
| 99 | message += `京东账号${$.index}${$.nickName}\n今日签到成功,获得${data.content[0].title} 🐶\n`; |
| 100 | allMsg += message; |
| 101 | } else if (data.code === -1) { |
| 102 | console.log(`今日已签到`) |
| 103 | // message += `【签到】失败,今日已签到`; |
| 104 | } else { |
| 105 | console.log(`异常:${JSON.stringify(data)}`) |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | } catch (e) { |
| 110 | $.logErr(e, resp) |
| 111 | } finally { |
| 112 | resolve(); |
| 113 | } |
| 114 | }) |
| 115 | }) |
| 116 | } |
| 117 | function taskUrl() { |
| 118 | return { |
| 119 | url: `https://lop-proxy.jd.com/jiFenApi/signInAndGetReward`, |