diff --git "a/app/providers/\344\274\201\346\237\245\346\237\245.js" "b/app/providers/\344\274\201\346\237\245\346\237\245.js" index a731ed2..86479fd 100644 --- "a/app/providers/\344\274\201\346\237\245\346\237\245.js" +++ "b/app/providers/\344\274\201\346\237\245\346\237\245.js" @@ -7,16 +7,18 @@ module.exports = class extends Provider { constructor() { super(); this.url = `http://www.qichacha.com/user_register`; + this.alone = true; } async resolve(ctx) { const options = ctx.options; const page = ctx.page; - await page.type('input[name=phone]', options.phone, { delay: 100 }); + await page.type('input[name=phone]', options.phone, { delay: 50 }); await page.type('input[name=pswd]', options.password, { delay: 50 }); + await utils.mockUserMouse(page); await page.mouse.move(841, 345); await page.mouse.down(); await page.mouse.move(1101, 346, { steps: 20 }); @@ -24,6 +26,13 @@ module.exports = class extends Provider { await page.click('a.get-mobile-code'); - // await page.waitForSelector('span.input-group-btn button:first-child[disabled]', { timeout: 1000 * 3 }); + const isSuccess = await page.evaluate(() => { + const btn = document.querySelector('a.get-mobile-code'); + return btn.innerText.indexOf('重新发送') >= 0; + }); + + if (!isSuccess) { + throw null; + } } };