Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
egg-puppeteer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
egg-puppeteer
Commits
cfaa57ae
Commit
cfaa57ae
authored
Jul 03, 2020
by
郝聪敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改返回数据
parent
d610ca85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
helper.js
app/extend/helper.js
+3
-3
home.js
app/service/home.js
+2
-2
No files found.
app/extend/helper.js
View file @
cfaa57ae
...
...
@@ -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
'
);
...
...
app/service/home.js
View file @
cfaa57ae
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment