Skip to content

Commit f77207c

Browse files
committed
修复[百度贴吧]日志记录吧名undefind问题
1 parent e531055 commit f77207c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎tieba/quanx/tieba.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function sign() {
4545
console.log(`签到成功: ${bar.forum_name}`)
4646
} else {
4747
signinfo.failedCnt += 1
48-
console.log(`签到失败: ${bar[1]}, 编码: ${signresult.no}, 原因: ${signresult.error}`)
48+
console.log(`签到失败: ${bar.forum_name}, 编码: ${signresult.no}, 原因: ${signresult.error}`)
4949
}
5050
}),
5151
singIndex * 100
@@ -63,6 +63,7 @@ function signBar(bar, tbs, cb) {
6363
headers: { Cookie: cookieVal },
6464
body: `ie=utf-8&kw=${bar.forum_name}&tbs=${tbs}`
6565
}
66+
url.headers['Content-Type'] = 'application/x-www-form-urlencoded'
6667
$task.fetch(url).then(cb)
6768
}
6869

‎tieba/tieba.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function sign() {
4343
console.log(`签到成功: ${bar.forum_name}`)
4444
} else {
4545
signinfo.failedCnt += 1
46-
console.log(`签到失败: ${bar[1]}, 编码: ${signresult.no}, 原因: ${signresult.error}`)
46+
console.log(`签到失败: ${bar.forum_name}, 编码: ${signresult.no}, 原因: ${signresult.error}`)
4747
}
4848
}),
4949
singIndex * 100
@@ -61,6 +61,7 @@ function signBar(bar, tbs, cb) {
6161
headers: { Cookie: cookieVal },
6262
body: `ie=utf-8&kw=${bar.forum_name}&tbs=${tbs}`
6363
}
64+
url.headers['Content-Type'] = 'application/x-www-form-urlencoded'
6465
$httpClient.post(url, cb)
6566
}
6667

0 commit comments

Comments
 (0)