Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
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
yaru
fgqyxxlr
Commits
89e21eec
Commit
89e21eec
authored
Dec 14, 2018
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证码配置补齐注释
parent
35df1dbc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
12 deletions
+26
-12
ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java
+26
-12
No files found.
ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java
View file @
89e21eec
...
...
@@ -19,27 +19,27 @@ public class CaptchaConfig
{
DefaultKaptcha
defaultKaptcha
=
new
DefaultKaptcha
();
Properties
properties
=
new
Properties
();
// 是否有边框
默认为true
我们可以自己设置yes,no
// 是否有边框
默认为true
我们可以自己设置yes,no
properties
.
setProperty
(
"kaptcha.border"
,
"yes"
);
// 边框颜色
默认为Color.BLACK
// 边框颜色
默认为Color.BLACK
properties
.
setProperty
(
"kaptcha.border.color"
,
"105,179,90"
);
// 验证码文本字符颜色
默认为Color.BLACK
// 验证码文本字符颜色
默认为Color.BLACK
properties
.
setProperty
(
"kaptcha.textproducer.font.color"
,
"blue"
);
// 验证码图片宽度
默认为200
// 验证码图片宽度
默认为200
properties
.
setProperty
(
"kaptcha.image.width"
,
"160"
);
// 验证码图片高度
默认为50
// 验证码图片高度 默认为50
properties
.
setProperty
(
"kaptcha.image.height"
,
"60"
);
// 验证码文本字符大小
默认为40
// 验证码文本字符大小 默认为40
properties
.
setProperty
(
"kaptcha.textproducer.font.size"
,
"30"
);
// KAPTCHA_SESSION_KEY
properties
.
setProperty
(
"kaptcha.session.key"
,
"kaptchaCode"
);
// 验证码文本字符间距
默认为2
// 验证码文本字符间距 默认为2
properties
.
setProperty
(
"kaptcha.textproducer.char.space"
,
"3"
);
// 验证码文本字符长度
默认为5
// 验证码文本字符长度 默认为5
properties
.
setProperty
(
"kaptcha.textproducer.char.length"
,
"5"
);
// 验证码文本字体样式
默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
// 验证码文本字体样式
默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
properties
.
setProperty
(
"kaptcha.textproducer.font.names"
,
"Arial,Courier"
);
// 验证码噪点颜色
默认为Color.BLACK
// 验证码噪点颜色 默认为Color.BLACK
properties
.
setProperty
(
"kaptcha.noise.color"
,
"white"
);
Config
config
=
new
Config
(
properties
);
defaultKaptcha
.
setConfig
(
config
);
...
...
@@ -51,19 +51,33 @@ public class CaptchaConfig
{
DefaultKaptcha
defaultKaptcha
=
new
DefaultKaptcha
();
Properties
properties
=
new
Properties
();
// 是否有边框 默认为true 我们可以自己设置yes,no
properties
.
setProperty
(
"kaptcha.border"
,
"yes"
);
// 边框颜色 默认为Color.BLACK
properties
.
setProperty
(
"kaptcha.border.color"
,
"105,179,90"
);
// 验证码文本字符颜色 默认为Color.BLACK
properties
.
setProperty
(
"kaptcha.textproducer.font.color"
,
"blue"
);
// 验证码图片宽度 默认为200
properties
.
setProperty
(
"kaptcha.image.width"
,
"160"
);
// 验证码图片高度 默认为50
properties
.
setProperty
(
"kaptcha.image.height"
,
"60"
);
properties
.
setProperty
(
"kaptcha.textproducer.font.size"
,
"38"
);
// 验证码文本字符大小 默认为40
properties
.
setProperty
(
"kaptcha.textproducer.font.size"
,
"35"
);
// KAPTCHA_SESSION_KEY
properties
.
setProperty
(
"kaptcha.session.key"
,
"kaptchaCodeMath"
);
// 验证码文本生成器
properties
.
setProperty
(
"kaptcha.textproducer.impl"
,
"com.ruoyi.framework.config.KaptchaTextCreator"
);
properties
.
setProperty
(
"kaptcha.textproducer.char.spac"
,
"5"
);
// 验证码文本字符间距 默认为2
properties
.
setProperty
(
"kaptcha.textproducer.char.space"
,
"3"
);
// 验证码文本字符长度 默认为5
properties
.
setProperty
(
"kaptcha.textproducer.char.length"
,
"6"
);
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
properties
.
setProperty
(
"kaptcha.textproducer.font.names"
,
"Arial,Courier"
);
// 验证码噪点颜色 默认为Color.BLACK
properties
.
setProperty
(
"kaptcha.noise.color"
,
"white"
);
// 干扰实现类
properties
.
setProperty
(
"kaptcha.noise.impl"
,
"com.google.code.kaptcha.impl.NoNoise"
);
// 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
properties
.
setProperty
(
"kaptcha.obscurificator.impl"
,
"com.google.code.kaptcha.impl.ShadowGimpy"
);
Config
config
=
new
Config
(
properties
);
defaultKaptcha
.
setConfig
(
config
);
...
...
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