Skip to content

Commit

Permalink
feat: 增加巨人网络的语言验证码
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Dec 3, 2017
1 parent 300b884 commit 5462e4b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/providers/巨人网络-语音验证.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

const Provider = require('../provider');
const utils = require('../utils');

module.exports = class extends Provider {
constructor() {
super();
this.url = `http://reg.ztgame.com/`;
}

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

await page.type('#reg_form input[name=phone]', options.phone, { delay: 50 });

// 获取语言验证码
await page.click('#reg_form input.voice_mpcode');

// 检验是否发生成功
try {
await page.waitForSelector('.get-mpcode[disabled]', { timeout: 1000 * 3 });
} catch (err) {
throw null;
}
}
};

0 comments on commit 5462e4b

Please sign in to comment.