main
tamguo 7 years ago
parent b353876b48
commit 82b302782e

@ -30,7 +30,7 @@ public class LoginController {
}
@ResponseBody
@RequestMapping(value = "login", method = RequestMethod.POST)
@RequestMapping(value = "sysLogin", method = RequestMethod.POST)
public Result toLogin(HttpServletRequest request, String username, String password, String captcha)
throws IOException {
try {

@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.google.code.kaptcha.Constants;
import com.google.code.kaptcha.Producer;
import com.tamguo.modules.sys.utils.ExceptionSupport;
import com.tamguo.modules.sys.utils.ShiroUtils;
@Controller
@ -40,9 +41,13 @@ public class ValidCodeController {
@RequestMapping("checkCode")
@ResponseBody
public Boolean checkCode(String validCode) throws ServletException, IOException {
String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY);
if (!validCode.equalsIgnoreCase(kaptcha)) {
return true;
try {
String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY);
if (!validCode.equalsIgnoreCase(kaptcha)) {
return true;
}
} catch (Exception e) {
ExceptionSupport.resolverResult("验证编码错误", this.getClass(), e);
}
return false;
}

@ -32,7 +32,7 @@
<a th:href="${setting.domain}"><b>TamGuo OMS</b> <small th:text="${setting.version}">1.0.0</small></a>
</div>
<div class="login-box-body">
<form id="loginForm" action="sys/login" method="post">
<form id="loginForm" th:action="${setting.domain + 'sysLogin'}" method="post">
<div class="form-group has-feedback">
<span class="glyphicon glyphicon-user form-control-feedback"
title="登录账号"></span> <input type="text" id="username"
@ -48,7 +48,7 @@
class="form-control required" data-msg-required="请填写登录密码."
placeholder="登录密码" autocomplete="off" />
</div>
<div class="form-group has-feedback" id="isValidCodeLogin">
<!-- <div class="form-group has-feedback" id="isValidCodeLogin">
<div class="input-group">
<span class="input-group-addon">验证码:</span> <input type="text"
id="validCode" name="validCode" class="form-control"
@ -79,7 +79,7 @@
validCodeImgRefresh();
}, 1000);
</script>
</div>
</div> -->
<div class="form-group">
<div class="mt5 icheck">
<label title="公共场所慎用,下次不需要再填写帐号"><input type="checkbox"

Loading…
Cancel
Save