From dfe033163479aa3449776c73ef9f313dcaa707a0 Mon Sep 17 00:00:00 2001 From: axetroy Date: Sun, 26 Nov 2017 17:53:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=96=9C=E5=9C=B0pro?= =?UTF-8?q?vider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "app/providers/\345\226\234\345\234\260.js" | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "app/providers/\345\226\234\345\234\260.js" diff --git "a/app/providers/\345\226\234\345\234\260.js" "b/app/providers/\345\226\234\345\234\260.js" new file mode 100644 index 0000000..ce5a7ba --- /dev/null +++ "b/app/providers/\345\226\234\345\234\260.js" @@ -0,0 +1,20 @@ +const Provider = require('../provider'); +const utils = require('../utils'); + +module.exports = class extends Provider { + constructor() { + super(); + this.url = `https://passport.xidibuy.com/reg/index`; + } + async resolve(ctx) { + const options = ctx.options; + const page = ctx.page; + + await page.type('#tel', options.phone, { delay: 100 }); + + await page.click('.getTelCode'); + + // 检验是否发送成功 + await page.waitForSelector('.getTelCode.notActive', { timeout: 1000 * 3 }); + } +};