Commit cfaa57ae authored by 郝聪敏's avatar 郝聪敏

修改返回数据

parent d610ca85
......@@ -26,7 +26,7 @@ module.exports = {
await page.waitFor(3000);
await page.click('#login_submit_btn');
},
async writeTecentLoginCode(page) {
async writeTecentLoginCode(page, account, password) {
const code = await this.getCode(page, '#vfcode');
if (!code) {
await page.click('#vfcode');
......@@ -36,8 +36,8 @@ module.exports = {
this.ctx.logger.info(`tecent mail: 获取到的验证码是${code}`);
await page.$eval('#inputuin', input => { input.value = ''; });
await page.$eval('#pp', input => { input.value = ''; });
await page.type('#inputuin', this.ctx.app.config.tecent.account);
await page.type('#pp', this.ctx.app.config.tecent.password);
await page.type('#inputuin', account);
await page.type('#pp', password);
await page.type('#vc', code);
await page.click('#auto_login_in_five_days_pwd');
await page.click('#btlogin');
......
......@@ -136,7 +136,7 @@ class HomeService extends Service {
while (VerifyArea && j < 100) {
j++;
ctx.logger.warn(`tecent mail: 第${j}次输入验证码!`);
await ctx.helper.writeTecentLoginCode(page);
await ctx.helper.writeTecentLoginCode(page, account, password);
await page.waitFor(5000);
VerifyArea = await page.$('#VerifyArea');
}
......@@ -212,7 +212,7 @@ class HomeService extends Service {
const imageName = `${email}_${Date.now()}.png`;
await mainFrameContainer.screenshot({ path: `./app/public/images/${imageName}` });
const imagePath = await service.fdfs.upload(path.join(__dirname, `../public/images/${imageName}`));
result.push({ id: mails[i].id, url: imagePath });
result.push({ id: mails[i].id, code: 0, url: imagePath });
await mainFrame.waitFor(parseInt((Math.random() * 3 + 1) * 1000, 10));
}
} catch (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment