Showing
4 changed files
with
6 additions
and
1 deletions
@@ -16,6 +16,8 @@ async function main() { | @@ -16,6 +16,8 @@ async function main() { | ||
16 | console.log(`${today} 工作`) | 16 | console.log(`${today} 工作`) |
17 | const res1 = await getconfig() | 17 | const res1 = await getconfig() |
18 | const {sessionkey} = await login() | 18 | const {sessionkey} = await login() |
19 | + console.log(`${today} 得到session ${sessionkey}`) | ||
20 | + | ||
19 | const res2 = await checkin({sessionkey}) | 21 | const res2 = await checkin({sessionkey}) |
20 | console.log(`${today} 签到成功 ${res2}`) | 22 | console.log(`${today} 签到成功 ${res2}`) |
21 | } | 23 | } |
@@ -16,6 +16,8 @@ async function main() { | @@ -16,6 +16,8 @@ async function main() { | ||
16 | console.log(`${today} 工作`) | 16 | console.log(`${today} 工作`) |
17 | const res1 = await getconfig() | 17 | const res1 = await getconfig() |
18 | const {sessionkey} = await login() | 18 | const {sessionkey} = await login() |
19 | + console.log(`${today} 得到session ${sessionkey}`) | ||
20 | + | ||
19 | const res2 = await checkout({sessionkey}) | 21 | const res2 = await checkout({sessionkey}) |
20 | console.log(`${today} 签出成功 ${res2}`) | 22 | console.log(`${today} 签出成功 ${res2}`) |
21 | } | 23 | } |
@@ -20,6 +20,7 @@ async function login() { | @@ -20,6 +20,7 @@ async function login() { | ||
20 | return new Promise(function(resolve, reject) { | 20 | return new Promise(function(resolve, reject) { |
21 | request.post('/client.do', { | 21 | request.post('/client.do', { |
22 | form: data, | 22 | form: data, |
23 | + json: true, | ||
23 | }, function(err, res, body) { | 24 | }, function(err, res, body) { |
24 | if (err) { | 25 | if (err) { |
25 | reject(err) | 26 | reject(err) |
-
Please register or login to post a comment