Skip to content

Commit

Permalink
feat: 添加中国移动provider
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Nov 19, 2017
1 parent d94bf50 commit 07e9a36
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/providers/中国移动.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const Provider = require('../provider');
const utils = require('../utils');

module.exports = class extends Provider {
constructor() {
super();
this.url = `https://www.cmpassport.com/umc/reg/alias/?from=9`;
}
async resolve(ctx) {
const options = ctx.options;
const page = ctx.page;

await utils.mockUserMouse(page);

await page.type('#txtPhone', options.phone, { delay: 50 });

await page.type('#txtSmsCode', options.phone, { delay: 50 });

await page.click('#btnGetSmsCode');

// 检验是否发送成功
await page.waitForSelector('.getSmsCode.BtnCode', { timeout: 1000 * 3 });
}
};

0 comments on commit 07e9a36

Please sign in to comment.