| 261 | } |
| 262 | |
| 263 | function doSign() { |
| 264 | return new Promise(async resolve => { |
| 265 | $.get(taskUrl('crazyJoy_task_doSign'), async (err, resp, data) => { |
| 266 | try { |
| 267 | if (err) { |
| 268 | console.log(`${JSON.stringify(err)}`) |
| 269 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 270 | } else { |
| 271 | if (safeGet(data)) { |
| 272 | data = JSON.parse(data); |
| 273 | if (data.success && data.data) { |
| 274 | console.log(`签到成功,获得${data.data.beans}京豆,${data.data.coins}金币`) |
| 275 | } else { |
| 276 | console.log(data.message) |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } catch (e) { |
| 281 | $.logErr(e, resp) |
| 282 | } finally { |
| 283 | resolve(); |
| 284 | } |
| 285 | }) |
| 286 | }) |
| 287 | } |
| 288 | |
| 289 | function doTask(taskId) { |
| 290 | let body = {"action": "MARK", "taskId": taskId} |