Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
27bf4fae
Commit
27bf4fae
authored
Oct 07, 2021
by
linlinjava
Browse files
feat[litemall-admin, litemal-admin-api]: 取消验证码相关逻辑。
parent
bdb7b983
Changes
2
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAuthController.java
View file @
27bf4fae
...
...
@@ -88,20 +88,20 @@ public class AdminAuthController {
public
Object
login
(
@RequestBody
String
body
,
HttpServletRequest
request
)
{
String
username
=
JacksonUtil
.
parseString
(
body
,
"username"
);
String
password
=
JacksonUtil
.
parseString
(
body
,
"password"
);
String
code
=
JacksonUtil
.
parseString
(
body
,
"code"
);
//
String code = JacksonUtil.parseString(body, "code");
if
(
StringUtils
.
isEmpty
(
username
)
||
StringUtils
.
isEmpty
(
password
))
{
return
ResponseUtil
.
badArgument
();
}
if
(
StringUtils
.
isEmpty
(
code
))
{
return
ResponseUtil
.
fail
(
ADMIN_INVALID_KAPTCHA_REQUIRED
,
"验证码不能空"
);
}
HttpSession
session
=
request
.
getSession
();
String
kaptcha
=
(
String
)
session
.
getAttribute
(
"kaptcha"
);
if
(
Objects
.
requireNonNull
(
code
).
compareToIgnoreCase
(
kaptcha
)
!=
0
)
{
return
ResponseUtil
.
fail
(
ADMIN_INVALID_KAPTCHA
,
"验证码不正确"
,
doKaptcha
(
request
));
}
//
if (StringUtils.isEmpty(code)) {
//
return ResponseUtil.fail(ADMIN_INVALID_KAPTCHA_REQUIRED, "验证码不能空");
//
}
//
HttpSession session = request.getSession();
//
String kaptcha = (String)session.getAttribute("kaptcha");
//
if (Objects.requireNonNull(code).compareToIgnoreCase(kaptcha) != 0) {
//
return ResponseUtil.fail(ADMIN_INVALID_KAPTCHA, "验证码不正确", doKaptcha(request));
//
}
Subject
currentUser
=
SecurityUtils
.
getSubject
();
try
{
...
...
litemall-admin/src/views/login/index.vue
View file @
27bf4fae
...
...
@@ -18,7 +18,7 @@
<el-input
v-model=
"loginForm.password"
:type=
"passwordType"
name=
"password"
auto-complete=
"on"
tabindex=
"2"
show-password
placeholder=
"管理员密码"
@
keyup.enter.native=
"handleLogin"
/>
</el-form-item>
<el-form-item
prop=
"code"
>
<!--
<el-form-item
prop=
"code"
>
<span
class=
"svg-container"
>
<svg-icon
icon-class=
"lock"
/>
</span>
...
...
@@ -26,7 +26,7 @@
<div
class=
"login-code"
>
<img
:src=
"codeImg"
@
click=
"getCode"
>
</div>
</el-form-item>
</el-form-item>
-->
<el-button
:loading=
"loading"
type=
"primary"
style=
"width:100%;margin-bottom:30px;"
@
click.native.prevent=
"handleLogin"
>
登录
</el-button>
...
...
@@ -47,7 +47,7 @@
</el-form>
<div
class=
"copyright"
>
Copyright © 202
0
xxx.com 版权所有
<a
href=
"http://
www.example.com/
"
>
沪ICP备xxx号
</a>
Copyright © 202
1
xxx.com 版权所有
<a
href=
"http
s
://
github.com/linlinjava/litemall
"
>
沪ICP备xxx号
</a>
</div>
</div>
</
template
>
...
...
Write
Preview
Supports
Markdown
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