Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
gechengyang
nouiWithSpringMVC
Commits
bb18eaaf
Commit
bb18eaaf
authored
Jan 27, 2021
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整登陆验证码生成
parent
61e3e41f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
VerifyCodeCreateController.java
...sentation/noui/controller/VerifyCodeCreateController.java
+3
-2
No files found.
src/main/java/org/sss/presentation/noui/controller/VerifyCodeCreateController.java
View file @
bb18eaaf
...
...
@@ -29,7 +29,7 @@ public class VerifyCodeCreateController {
final
static
String
STR
=
"QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890"
;
private
static
final
Log
log
=
LogFactory
.
getLog
(
VerifyCodeCreateController
.
class
);
private
static
final
int
width
=
100
;
//验证码图片宽度
private
static
final
int
height
=
5
0
;
//验证码图片高度
private
static
final
int
height
=
4
0
;
//验证码图片高度
private
static
final
int
vcsessionout
=
120
;
//验证码超时时间
final
float
yawpRate
=
0.05f
;
// 噪声率
final
int
area
=
(
int
)
(
yawpRate
*
width
*
height
);
...
...
@@ -84,7 +84,8 @@ public class VerifyCodeCreateController {
g
.
setColor
(
new
Color
(
r
.
nextInt
(
88
),
r
.
nextInt
(
188
),
r
.
nextInt
(
255
)));
Font
font
=
new
Font
(
"Times New Roman"
,
Font
.
ITALIC
,
fontSize
);
g
.
setFont
(
font
);
g
.
drawString
(
code
,
(
i
*
18
)
+
10
,
30
);
float
x
=
i
*
1.0
F
*
width
/
4
;
g
.
drawString
(
code
,
x
,
height
-
5
);
codes
.
append
(
code
);
}
StringBuilder
key
=
new
StringBuilder
(
codes
);
...
...
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