Showing
10 changed files
with
535 additions
and
5 deletions
checkin.js
0 → 100644
1 | +const getconfig = require('./task/getconfig') | ||
2 | +const login = require('./task/login') | ||
3 | +const checkin = require('./task/checkin') | ||
4 | + | ||
5 | +async function main() { | ||
6 | + const res1 = await getconfig() | ||
7 | + const {sessionkey} = await login() | ||
8 | + const res2 = await checkin({sessionkey}) | ||
9 | + console.log('签到成功',res2) | ||
10 | +} | ||
11 | + | ||
12 | +main().catch(err => console.log(err)) |
checkout.js
0 → 100644
1 | +const getconfig = require('./task/getconfig') | ||
2 | +const login = require('./task/login') | ||
3 | +const checkout = require('./task/checkout') | ||
4 | + | ||
5 | +async function main() { | ||
6 | + const res1 = await getconfig() | ||
7 | + const {sessionkey} = await login() | ||
8 | + const res2 = await checkout({sessionkey}) | ||
9 | + console.log('签出成功',res2) | ||
10 | +} | ||
11 | + | ||
12 | +main().catch(err => console.log(err)) |
index.js
deleted
100644 → 0
@@ -4,15 +4,133 @@ | @@ -4,15 +4,133 @@ | ||
4 | "lockfileVersion": 1, | 4 | "lockfileVersion": 1, |
5 | "requires": true, | 5 | "requires": true, |
6 | "dependencies": { | 6 | "dependencies": { |
7 | + "@types/tough-cookie": { | ||
8 | + "version": "2.3.2", | ||
9 | + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.2.tgz", | ||
10 | + "integrity": "sha512-vOVmaruQG5EatOU/jM6yU2uCp3Lz6mK1P5Ztu4iJjfM4SVHU9XYktPUQtKlIXuahqXHdEyUarMrBEwg5Cwu+bA==" | ||
11 | + }, | ||
12 | + "ajv": { | ||
13 | + "version": "5.5.2", | ||
14 | + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", | ||
15 | + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", | ||
16 | + "requires": { | ||
17 | + "co": "4.6.0", | ||
18 | + "fast-deep-equal": "1.1.0", | ||
19 | + "fast-json-stable-stringify": "2.0.0", | ||
20 | + "json-schema-traverse": "0.3.1" | ||
21 | + } | ||
22 | + }, | ||
23 | + "asn1": { | ||
24 | + "version": "0.2.3", | ||
25 | + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", | ||
26 | + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" | ||
27 | + }, | ||
28 | + "assert-plus": { | ||
29 | + "version": "1.0.0", | ||
30 | + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", | ||
31 | + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" | ||
32 | + }, | ||
33 | + "asynckit": { | ||
34 | + "version": "0.4.0", | ||
35 | + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", | ||
36 | + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" | ||
37 | + }, | ||
38 | + "aws-sign2": { | ||
39 | + "version": "0.7.0", | ||
40 | + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", | ||
41 | + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" | ||
42 | + }, | ||
43 | + "aws4": { | ||
44 | + "version": "1.6.0", | ||
45 | + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", | ||
46 | + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" | ||
47 | + }, | ||
7 | "axios": { | 48 | "axios": { |
8 | - "version": "0.17.1", | ||
9 | - "resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz", | ||
10 | - "integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=", | 49 | + "version": "0.18.0", |
50 | + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", | ||
51 | + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", | ||
11 | "requires": { | 52 | "requires": { |
12 | "follow-redirects": "1.4.1", | 53 | "follow-redirects": "1.4.1", |
13 | "is-buffer": "1.1.6" | 54 | "is-buffer": "1.1.6" |
14 | } | 55 | } |
15 | }, | 56 | }, |
57 | + "axios-cookiejar-support": { | ||
58 | + "version": "0.3.4", | ||
59 | + "resolved": "https://registry.npmjs.org/axios-cookiejar-support/-/axios-cookiejar-support-0.3.4.tgz", | ||
60 | + "integrity": "sha512-kvQMPfnlr9LKTYJ38L+7gT2tVcGY5dzJmhbwem4fSCUvfnmwnrT5yxR1LJQusQhaKRDEbDl7xX6AwcPbVJYBxg==", | ||
61 | + "requires": { | ||
62 | + "@types/tough-cookie": "2.3.2", | ||
63 | + "is-redirect": "1.0.0", | ||
64 | + "pify": "3.0.0", | ||
65 | + "tough-cookie": "2.3.3" | ||
66 | + } | ||
67 | + }, | ||
68 | + "bcrypt-pbkdf": { | ||
69 | + "version": "1.0.1", | ||
70 | + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", | ||
71 | + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", | ||
72 | + "optional": true, | ||
73 | + "requires": { | ||
74 | + "tweetnacl": "0.14.5" | ||
75 | + } | ||
76 | + }, | ||
77 | + "boom": { | ||
78 | + "version": "4.3.1", | ||
79 | + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", | ||
80 | + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", | ||
81 | + "requires": { | ||
82 | + "hoek": "4.2.1" | ||
83 | + } | ||
84 | + }, | ||
85 | + "caseless": { | ||
86 | + "version": "0.12.0", | ||
87 | + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", | ||
88 | + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" | ||
89 | + }, | ||
90 | + "co": { | ||
91 | + "version": "4.6.0", | ||
92 | + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", | ||
93 | + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" | ||
94 | + }, | ||
95 | + "combined-stream": { | ||
96 | + "version": "1.0.6", | ||
97 | + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", | ||
98 | + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", | ||
99 | + "requires": { | ||
100 | + "delayed-stream": "1.0.0" | ||
101 | + } | ||
102 | + }, | ||
103 | + "core-util-is": { | ||
104 | + "version": "1.0.2", | ||
105 | + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", | ||
106 | + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" | ||
107 | + }, | ||
108 | + "cryptiles": { | ||
109 | + "version": "3.1.2", | ||
110 | + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", | ||
111 | + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", | ||
112 | + "requires": { | ||
113 | + "boom": "5.2.0" | ||
114 | + }, | ||
115 | + "dependencies": { | ||
116 | + "boom": { | ||
117 | + "version": "5.2.0", | ||
118 | + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", | ||
119 | + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", | ||
120 | + "requires": { | ||
121 | + "hoek": "4.2.1" | ||
122 | + } | ||
123 | + } | ||
124 | + } | ||
125 | + }, | ||
126 | + "dashdash": { | ||
127 | + "version": "1.14.1", | ||
128 | + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", | ||
129 | + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", | ||
130 | + "requires": { | ||
131 | + "assert-plus": "1.0.0" | ||
132 | + } | ||
133 | + }, | ||
16 | "debug": { | 134 | "debug": { |
17 | "version": "3.1.0", | 135 | "version": "3.1.0", |
18 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", | 136 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", |
@@ -21,6 +139,40 @@ | @@ -21,6 +139,40 @@ | ||
21 | "ms": "2.0.0" | 139 | "ms": "2.0.0" |
22 | } | 140 | } |
23 | }, | 141 | }, |
142 | + "delayed-stream": { | ||
143 | + "version": "1.0.0", | ||
144 | + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", | ||
145 | + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" | ||
146 | + }, | ||
147 | + "ecc-jsbn": { | ||
148 | + "version": "0.1.1", | ||
149 | + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", | ||
150 | + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", | ||
151 | + "optional": true, | ||
152 | + "requires": { | ||
153 | + "jsbn": "0.1.1" | ||
154 | + } | ||
155 | + }, | ||
156 | + "extend": { | ||
157 | + "version": "3.0.1", | ||
158 | + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", | ||
159 | + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" | ||
160 | + }, | ||
161 | + "extsprintf": { | ||
162 | + "version": "1.3.0", | ||
163 | + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", | ||
164 | + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" | ||
165 | + }, | ||
166 | + "fast-deep-equal": { | ||
167 | + "version": "1.1.0", | ||
168 | + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", | ||
169 | + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" | ||
170 | + }, | ||
171 | + "fast-json-stable-stringify": { | ||
172 | + "version": "2.0.0", | ||
173 | + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", | ||
174 | + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" | ||
175 | + }, | ||
24 | "follow-redirects": { | 176 | "follow-redirects": { |
25 | "version": "1.4.1", | 177 | "version": "1.4.1", |
26 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", | 178 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", |
@@ -29,15 +181,262 @@ | @@ -29,15 +181,262 @@ | ||
29 | "debug": "3.1.0" | 181 | "debug": "3.1.0" |
30 | } | 182 | } |
31 | }, | 183 | }, |
184 | + "forever-agent": { | ||
185 | + "version": "0.6.1", | ||
186 | + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", | ||
187 | + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" | ||
188 | + }, | ||
189 | + "form-data": { | ||
190 | + "version": "2.3.2", | ||
191 | + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", | ||
192 | + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", | ||
193 | + "requires": { | ||
194 | + "asynckit": "0.4.0", | ||
195 | + "combined-stream": "1.0.6", | ||
196 | + "mime-types": "2.1.18" | ||
197 | + } | ||
198 | + }, | ||
199 | + "getpass": { | ||
200 | + "version": "0.1.7", | ||
201 | + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", | ||
202 | + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", | ||
203 | + "requires": { | ||
204 | + "assert-plus": "1.0.0" | ||
205 | + } | ||
206 | + }, | ||
207 | + "har-schema": { | ||
208 | + "version": "2.0.0", | ||
209 | + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", | ||
210 | + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" | ||
211 | + }, | ||
212 | + "har-validator": { | ||
213 | + "version": "5.0.3", | ||
214 | + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", | ||
215 | + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", | ||
216 | + "requires": { | ||
217 | + "ajv": "5.5.2", | ||
218 | + "har-schema": "2.0.0" | ||
219 | + } | ||
220 | + }, | ||
221 | + "hawk": { | ||
222 | + "version": "6.0.2", | ||
223 | + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", | ||
224 | + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", | ||
225 | + "requires": { | ||
226 | + "boom": "4.3.1", | ||
227 | + "cryptiles": "3.1.2", | ||
228 | + "hoek": "4.2.1", | ||
229 | + "sntp": "2.1.0" | ||
230 | + } | ||
231 | + }, | ||
232 | + "hoek": { | ||
233 | + "version": "4.2.1", | ||
234 | + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", | ||
235 | + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" | ||
236 | + }, | ||
237 | + "http-signature": { | ||
238 | + "version": "1.2.0", | ||
239 | + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", | ||
240 | + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", | ||
241 | + "requires": { | ||
242 | + "assert-plus": "1.0.0", | ||
243 | + "jsprim": "1.4.1", | ||
244 | + "sshpk": "1.13.1" | ||
245 | + } | ||
246 | + }, | ||
32 | "is-buffer": { | 247 | "is-buffer": { |
33 | "version": "1.1.6", | 248 | "version": "1.1.6", |
34 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", | 249 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", |
35 | "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" | 250 | "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" |
36 | }, | 251 | }, |
252 | + "is-redirect": { | ||
253 | + "version": "1.0.0", | ||
254 | + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", | ||
255 | + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" | ||
256 | + }, | ||
257 | + "is-typedarray": { | ||
258 | + "version": "1.0.0", | ||
259 | + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", | ||
260 | + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" | ||
261 | + }, | ||
262 | + "isstream": { | ||
263 | + "version": "0.1.2", | ||
264 | + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", | ||
265 | + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" | ||
266 | + }, | ||
267 | + "jsbn": { | ||
268 | + "version": "0.1.1", | ||
269 | + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", | ||
270 | + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", | ||
271 | + "optional": true | ||
272 | + }, | ||
273 | + "json-schema": { | ||
274 | + "version": "0.2.3", | ||
275 | + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", | ||
276 | + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" | ||
277 | + }, | ||
278 | + "json-schema-traverse": { | ||
279 | + "version": "0.3.1", | ||
280 | + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", | ||
281 | + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" | ||
282 | + }, | ||
283 | + "json-stringify-safe": { | ||
284 | + "version": "5.0.1", | ||
285 | + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", | ||
286 | + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" | ||
287 | + }, | ||
288 | + "jsprim": { | ||
289 | + "version": "1.4.1", | ||
290 | + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", | ||
291 | + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", | ||
292 | + "requires": { | ||
293 | + "assert-plus": "1.0.0", | ||
294 | + "extsprintf": "1.3.0", | ||
295 | + "json-schema": "0.2.3", | ||
296 | + "verror": "1.10.0" | ||
297 | + } | ||
298 | + }, | ||
299 | + "mime-db": { | ||
300 | + "version": "1.33.0", | ||
301 | + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", | ||
302 | + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" | ||
303 | + }, | ||
304 | + "mime-types": { | ||
305 | + "version": "2.1.18", | ||
306 | + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", | ||
307 | + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", | ||
308 | + "requires": { | ||
309 | + "mime-db": "1.33.0" | ||
310 | + } | ||
311 | + }, | ||
37 | "ms": { | 312 | "ms": { |
38 | "version": "2.0.0", | 313 | "version": "2.0.0", |
39 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", | 314 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", |
40 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" | 315 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" |
316 | + }, | ||
317 | + "oauth-sign": { | ||
318 | + "version": "0.8.2", | ||
319 | + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", | ||
320 | + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" | ||
321 | + }, | ||
322 | + "performance-now": { | ||
323 | + "version": "2.1.0", | ||
324 | + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", | ||
325 | + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" | ||
326 | + }, | ||
327 | + "pify": { | ||
328 | + "version": "3.0.0", | ||
329 | + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", | ||
330 | + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" | ||
331 | + }, | ||
332 | + "punycode": { | ||
333 | + "version": "1.4.1", | ||
334 | + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", | ||
335 | + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" | ||
336 | + }, | ||
337 | + "qs": { | ||
338 | + "version": "6.5.1", | ||
339 | + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", | ||
340 | + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" | ||
341 | + }, | ||
342 | + "request": { | ||
343 | + "version": "2.83.0", | ||
344 | + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", | ||
345 | + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", | ||
346 | + "requires": { | ||
347 | + "aws-sign2": "0.7.0", | ||
348 | + "aws4": "1.6.0", | ||
349 | + "caseless": "0.12.0", | ||
350 | + "combined-stream": "1.0.6", | ||
351 | + "extend": "3.0.1", | ||
352 | + "forever-agent": "0.6.1", | ||
353 | + "form-data": "2.3.2", | ||
354 | + "har-validator": "5.0.3", | ||
355 | + "hawk": "6.0.2", | ||
356 | + "http-signature": "1.2.0", | ||
357 | + "is-typedarray": "1.0.0", | ||
358 | + "isstream": "0.1.2", | ||
359 | + "json-stringify-safe": "5.0.1", | ||
360 | + "mime-types": "2.1.18", | ||
361 | + "oauth-sign": "0.8.2", | ||
362 | + "performance-now": "2.1.0", | ||
363 | + "qs": "6.5.1", | ||
364 | + "safe-buffer": "5.1.1", | ||
365 | + "stringstream": "0.0.5", | ||
366 | + "tough-cookie": "2.3.3", | ||
367 | + "tunnel-agent": "0.6.0", | ||
368 | + "uuid": "3.2.1" | ||
369 | + } | ||
370 | + }, | ||
371 | + "safe-buffer": { | ||
372 | + "version": "5.1.1", | ||
373 | + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", | ||
374 | + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" | ||
375 | + }, | ||
376 | + "sntp": { | ||
377 | + "version": "2.1.0", | ||
378 | + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", | ||
379 | + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", | ||
380 | + "requires": { | ||
381 | + "hoek": "4.2.1" | ||
382 | + } | ||
383 | + }, | ||
384 | + "sshpk": { | ||
385 | + "version": "1.13.1", | ||
386 | + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", | ||
387 | + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", | ||
388 | + "requires": { | ||
389 | + "asn1": "0.2.3", | ||
390 | + "assert-plus": "1.0.0", | ||
391 | + "bcrypt-pbkdf": "1.0.1", | ||
392 | + "dashdash": "1.14.1", | ||
393 | + "ecc-jsbn": "0.1.1", | ||
394 | + "getpass": "0.1.7", | ||
395 | + "jsbn": "0.1.1", | ||
396 | + "tweetnacl": "0.14.5" | ||
397 | + } | ||
398 | + }, | ||
399 | + "stringstream": { | ||
400 | + "version": "0.0.5", | ||
401 | + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", | ||
402 | + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" | ||
403 | + }, | ||
404 | + "tough-cookie": { | ||
405 | + "version": "2.3.3", | ||
406 | + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", | ||
407 | + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", | ||
408 | + "requires": { | ||
409 | + "punycode": "1.4.1" | ||
410 | + } | ||
411 | + }, | ||
412 | + "tunnel-agent": { | ||
413 | + "version": "0.6.0", | ||
414 | + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", | ||
415 | + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", | ||
416 | + "requires": { | ||
417 | + "safe-buffer": "5.1.1" | ||
418 | + } | ||
419 | + }, | ||
420 | + "tweetnacl": { | ||
421 | + "version": "0.14.5", | ||
422 | + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", | ||
423 | + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", | ||
424 | + "optional": true | ||
425 | + }, | ||
426 | + "uuid": { | ||
427 | + "version": "3.2.1", | ||
428 | + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", | ||
429 | + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" | ||
430 | + }, | ||
431 | + "verror": { | ||
432 | + "version": "1.10.0", | ||
433 | + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", | ||
434 | + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", | ||
435 | + "requires": { | ||
436 | + "assert-plus": "1.0.0", | ||
437 | + "core-util-is": "1.0.2", | ||
438 | + "extsprintf": "1.3.0" | ||
439 | + } | ||
41 | } | 440 | } |
42 | } | 441 | } |
43 | } | 442 | } |
@@ -4,12 +4,13 @@ | @@ -4,12 +4,13 @@ | ||
4 | "description": "", | 4 | "description": "", |
5 | "main": "index.js", | 5 | "main": "index.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | - "test": "echo \"Error: no test specified\" && exit 1" | 7 | + "checkin": "node checkin.js", |
8 | + "checkout": "node checkout.js" | ||
8 | }, | 9 | }, |
9 | "keywords": [], | 10 | "keywords": [], |
10 | "author": "", | 11 | "author": "", |
11 | "license": "ISC", | 12 | "license": "ISC", |
12 | "dependencies": { | 13 | "dependencies": { |
13 | - "axios": "^0.17.1" | 14 | + "request": "^2.83.0" |
14 | } | 15 | } |
15 | } | 16 | } |
task/checkin.js
0 → 100644
1 | +const request = require('./request') | ||
2 | + | ||
3 | +const data = { | ||
4 | + method: "checkin", | ||
5 | + type: "checkin", | ||
6 | + latlng: "31.982921,118.733974", | ||
7 | + addr: "%E6%B1%9F%E8%8B%8F%E7%9C%81%E5%8D%97%E4%BA%AC%E5%B8%82%E5%BB%BA%E9%82%BA%E5%8C%BA%E5%88%9B%E6%99%BA%E8%B7%AF24%E5%8F%B7%E9%9D%A0%E8%BF%91%E4%B8%AD%E5%9B%BD%E5%B7%A5%E5%95%86%E9%93%B6%E8%A1%8C(%E5%98%89%E9%99%B5%E6%B1%9F%E4%B8%9C%E8%A1%97%E6%94%AF%E8%A1%8C)", | ||
8 | + sessionkey: "abc14l9XQT_HW61HNFegw", | ||
9 | + wifiMac: "null HTTP/1.1" | ||
10 | +} | ||
11 | + | ||
12 | +async function checkin(sessionkey) { | ||
13 | + return new Promise(function(resolve, reject) { | ||
14 | + request.get('/client.do', {qs: Object.assign(data, sessionkey)}, function(err, res, body) { | ||
15 | + if (err) { | ||
16 | + reject(err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + resolve(body) | ||
21 | + }) | ||
22 | + }) | ||
23 | +} | ||
24 | + | ||
25 | +module.exports = checkin |
task/checkout.js
0 → 100644
1 | +const request = require('./request') | ||
2 | + | ||
3 | +const data = { | ||
4 | + method: "checkin", | ||
5 | + type: "checkout", | ||
6 | + latlng: "31.982921,118.733974", | ||
7 | + addr: "%E6%B1%9F%E8%8B%8F%E7%9C%81%E5%8D%97%E4%BA%AC%E5%B8%82%E5%BB%BA%E9%82%BA%E5%8C%BA%E5%88%9B%E6%99%BA%E8%B7%AF24%E5%8F%B7%E9%9D%A0%E8%BF%91%E4%B8%AD%E5%9B%BD%E5%B7%A5%E5%95%86%E9%93%B6%E8%A1%8C(%E5%98%89%E9%99%B5%E6%B1%9F%E4%B8%9C%E8%A1%97%E6%94%AF%E8%A1%8C)", | ||
8 | + sessionkey: "abc14l9XQT_HW61HNFegw", | ||
9 | + wifiMac: "null HTTP/1.1" | ||
10 | +} | ||
11 | + | ||
12 | +async function checkout(sessionkey) { | ||
13 | + return new Promise(function(resolve, reject) { | ||
14 | + request.get('/client.do', {qs: Object.assign(data, sessionkey)}, function(err, res, body) { | ||
15 | + if (err) { | ||
16 | + reject(err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + resolve(body) | ||
21 | + }) | ||
22 | + }) | ||
23 | +} | ||
24 | + | ||
25 | +module.exports = checkout |
task/getconfig.js
0 → 100644
1 | +const request = require('./request') | ||
2 | + | ||
3 | +async function getconfig() { | ||
4 | + return new Promise(function(resolve, reject) { | ||
5 | + request.post('/client.do?method=getconfig', (err,res,body) => { | ||
6 | + if (err) { | ||
7 | + reject(err) | ||
8 | + return | ||
9 | + } | ||
10 | + | ||
11 | + resolve(body) | ||
12 | + }) | ||
13 | + }) | ||
14 | +} | ||
15 | + | ||
16 | +module.exports = getconfig |
task/login.js
0 → 100644
1 | +const request = require('./request') | ||
2 | + | ||
3 | +const data = { | ||
4 | + "method": "login", | ||
5 | + "loginid": "tao.huang", | ||
6 | + "password": "huangtao3.1415926", | ||
7 | + "isneedmoulds": 1, | ||
8 | + "client": 1, | ||
9 | + "clientver": "6.5.38", | ||
10 | + "udid": "868233033762392", | ||
11 | + "clientos": "NMF26X", | ||
12 | + "clientosver": "7.1.1", | ||
13 | + "clienttype": "android", | ||
14 | + "language": "en", | ||
15 | + "country": "US", | ||
16 | + "relogin": 1 | ||
17 | +} | ||
18 | + | ||
19 | +async function login() { | ||
20 | + return new Promise(function(resolve, reject) { | ||
21 | + request.post('/client.do', { | ||
22 | + form: data, | ||
23 | + }, function(err, res, body) { | ||
24 | + if (err) { | ||
25 | + reject(err) | ||
26 | + return | ||
27 | + } | ||
28 | + | ||
29 | + resolve(body) | ||
30 | + }) | ||
31 | + }) | ||
32 | +} | ||
33 | + | ||
34 | +module.exports = login |
-
Please register or login to post a comment