MCPcopy Create free account
hub / github.com/ClydeTime/Surge / checkin

Function checkin

Script/Task/nga.js:109–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107
108
109async 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
141async function missions() {
142 const newBody = { ...JSON.parse(config.body) };

Callers 1

signNGAFunction · 0.85

Calls 6

ObjectToFormDataFunction · 0.85
parseMethod · 0.45
postMethod · 0.45
msgMethod · 0.45
joinMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected