-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
}; |