From f0b5ee537b0719556ef80c814f1b5a1ec4c7f0da Mon Sep 17 00:00:00 2001 From: haptear Date: Tue, 22 Feb 2022 17:52:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B8=85=E7=90=86=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 58tc.js | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/58tc.js b/58tc.js index e16fa2b..b095e44 100644 --- a/58tc.js +++ b/58tc.js @@ -246,6 +246,20 @@ class UserInfo { //打扫房间 async houseClean () { + let furnitureId = await this.houseGetCleanId(); + while (furnitureId != '0') { + url = `https://lovely-house.58.com/housework/clean` + body = `furnitureId=${index}` + urlObject = populateUrlObject(url, this.cookie, body) + await httpRequest('post', urlObject) + result = httpResult; + //if(result.code == 0) + //break; + furnitureId = await houseGetCleanId(); + } + } + + async houseGetCleanId () { let url = `https://lovely-house.58.com/housework/get` let body = `` let urlObject = populateUrlObject(url, this.cookie, body) @@ -255,19 +269,11 @@ class UserInfo { //console.log(result) if (result.code == 0) { if (!result.result || !result.result.houseworkTaskVOList || result.result.houseworkTaskVOList.length == 0) - return; - for (let index = 1; index < 10; index++) { - url = `https://lovely-house.58.com/housework/clean` - body = `furnitureId=${index}` - urlObject = populateUrlObject(url, this.cookie, body) - await httpRequest('post', urlObject) - result = httpResult; - //if(result.code == 0) - //break; - } - } else { - console.log(`账号[${this.index}]查询打扫房间状态失败: ${result.message}`) + return '0'; + console.log(`账号[${this.index}] 清理房间 ${result.result.houseworkTaskVOList[0].tip}`); + return result.result.houseworkTaskVOList[0].furnitureId; } + return '0'; } async houseWithdrawPage () { @@ -647,7 +653,7 @@ class UserInfo { if (!(await checkEnv())) return console.log('====================\n') console.log(`如果要自定义UA,请把UA填到wbtcUA里,现在使用的UA是:\n${userUA}`) - + console.log('\n================== 现金签到 ==================') for (let user of userList) { await user.cashSigninlist();