Skip to content

Commit

Permalink
fix: 麦付宝provider没有正确检测是否发送短信成功
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Dec 3, 2017
1 parent 091dd15 commit 27a49ff
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/providers/麦付宝.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ module.exports = class extends Provider {
constructor() {
super();
this.url = `https://www.maifupay.com/register`;
this.alone = true;
}

async resolve(ctx) {
const options = ctx.options;
const page = ctx.page;

await page.type('input.form-control', options.phone, { delay: 100 });
await page.type('input[name="mobile"]', options.phone, { delay: 50 });

await page.click('span.input-group-btn button:first-child');
await page.click('#sendVerifySmsButton');

// await page.waitForSelector('span.input-group-btn button:first-child[disabled]', { timeout: 1000 * 3 });
await utils.sleep(1000);

try {
await page.waitForSelector('#sendVerifySmsButton[disabled]');
} catch (err) {
throw null;
}
}
};

0 comments on commit 27a49ff

Please sign in to comment.