| 107 | |
| 108 | |
| 109 | async function checkin() { |
| 110 | const newBody = { ...JSON.parse(config.body) }; |
| 111 | newBody["__lib"] = "check_in"; |
| 112 | newBody["__act"] = "check_in"; |
| 113 | const options = { |
| 114 | url: "https://ngabbs.com/nuke.php", |
| 115 | headers: { |
| 116 | "Content-Type": config.contentType, |
| 117 | Cookie: config.cookie, |
| 118 | "User-Agent": config.userAgent, |
| 119 | }, |
| 120 | body: ObjectToFormData(newBody, config.contentType) |
| 121 | }; |
| 122 | return await $.http.post(options).then( |
| 123 | (response) => { |
| 124 | if (response.status === 200) { |
| 125 | const result = JSON.parse(response.body); |
| 126 | if (result.error) { |
| 127 | $.msg(name, "刮墙失败", result.error.join(";")); |
| 128 | } else if (result.data) { |
| 129 | const message = result.data[0]; |
| 130 | const continued = result.data[1].continued; |
| 131 | const sum = result.data[1].sum; |
| 132 | $.msg(name, message, `连续刮墙${continued}天,累计刮墙${sum}天`); |
| 133 | } |
| 134 | } |
| 135 | },(reason) => { |
| 136 | $.logErr(reason.err, reason); |
| 137 | $.msg(name, "刮墙失败,详细参见日志", reason.err); |
| 138 | }); |
| 139 | } |
| 140 | |
| 141 | async function missions() { |
| 142 | const newBody = { ...JSON.parse(config.body) }; |