Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
40f747a97fda84fd243f6de259c14d628efb53df
1 parent
51bd8707
fix capthca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
apps/passport/controllers/captcha.js
apps/passport/models/captcha-service.js
apps/passport/controllers/captcha.js
View file @
40f747a
...
...
@@ -87,11 +87,9 @@ const generateQiniu = (req, res, next) => {
req
.
session
.
captcha
=
result
.
data
.
text
;
req
.
session
.
captchaCount
=
0
;
let
imageUrl
=
result
.
data
.
images
+
`
/
watermark
/
2
/
text
/
$
{
uuid
.
v4
()}
/fontsize/
120
/
dissolve
/
10
`
;
res
.
type
(
'png'
);
if
(
result
.
code
===
200
)
{
request
(
imageUrl
).
pipe
(
res
);
request
(
result
.
data
.
images
).
pipe
(
res
);
}
}).
catch
(
next
);
...
...
apps/passport/models/captcha-service.js
View file @
40f747a
...
...
@@ -5,6 +5,7 @@
'use strict'
;
const
api
=
require
(
'./captcha-api'
);
const
uuid
=
require
(
'uuid'
);
exports
.
generateCaptcha
=
()
=>
{
return
api
.
gen
().
then
((
result
)
=>
{
...
...
@@ -17,7 +18,8 @@ exports.generateCaptcha = () => {
code
:
200
,
data
:
{
text
:
codeStr
,
images
:
`
$
{
result
.
data
.
verifiedGraphicCode
}?
imageView
/
2
/
w
/
240
`
images
:
`
$
{
result
.
data
.
verifiedGraphicCode
}
`
+
`
?
imageView
/
2
/
w
/
240
/
watermark
/
2
/
text
/
$
{
uuid
.
v4
()}
/fontsize/
120
/
dissolve
/
10
`
}
};
}
else
{
...
...
Please
register
or
login
to post a comment