Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
znn1980
web-admin
提交
5aecbdac
W
web-admin
项目概览
znn1980
/
web-admin
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
web-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5aecbdac
编写于
10月 04, 2020
作者:
znn1980
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update 验证码减法的错误
上级
2e6f75d8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
1 deletion
+4
-1
src/main/java/com/ifacebox/web/admin/master/controller/MasterViewController.java
...box/web/admin/master/controller/MasterViewController.java
+3
-0
src/main/java/com/ifacebox/web/common/captcha/CalcMathTextCreator.java
.../com/ifacebox/web/common/captcha/CalcMathTextCreator.java
+1
-1
未找到文件。
src/main/java/com/ifacebox/web/admin/master/controller/MasterViewController.java
浏览文件 @
5aecbdac
...
...
@@ -40,6 +40,9 @@ public class MasterViewController extends BaseViewController {
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
response
.
setContentType
(
"image/jpeg"
);
String
text
=
calcMathCaptcha
.
getProducer
().
createText
();
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"验证码:{}"
,
text
);
}
masterUserService
.
setCaptcha
(
request
.
getSession
(
true
),
calcMathCaptcha
.
parseResult
(
text
));
BufferedImage
image
=
calcMathCaptcha
.
getProducer
().
createImage
(
calcMathCaptcha
.
parseText
(
text
));
ImageIO
.
write
(
image
,
"jpg"
,
response
.
getOutputStream
());
...
...
src/main/java/com/ifacebox/web/common/captcha/CalcMathTextCreator.java
浏览文件 @
5aecbdac
...
...
@@ -32,7 +32,7 @@ public class CalcMathTextCreator extends DefaultTextCreator {
}
else
if
(
calc
==
CALC_SUBTRACTION
)
{
//减法,交换位置不出现负数
result
=
x
>=
y
?
x
-
y
:
y
-
x
;
text
.
append
(
x
>=
y
?
CALC_MATH_NUMBER
[
x
]
:
CALC_MATH_NUMBER
[
y
]).
append
(
CALC_SYMBOL
[
CALC_SUBTRACTION
]).
append
(
x
>=
y
?
CALC_MATH_NUMBER
[
x
]
:
CALC_MATH_NUMBER
[
y
]);
text
.
append
(
x
>=
y
?
CALC_MATH_NUMBER
[
x
]
:
CALC_MATH_NUMBER
[
y
]).
append
(
CALC_SYMBOL
[
CALC_SUBTRACTION
]).
append
(
x
>=
y
?
CALC_MATH_NUMBER
[
y
]
:
CALC_MATH_NUMBER
[
x
]);
}
else
if
(
calc
==
CALC_MULTIPLICATION
)
{
//乘法
result
=
x
*
y
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录