Skip to content

Commit

Permalink
💄 验证码显示优化及提示语修改
Browse files Browse the repository at this point in the history
  • Loading branch information
newbee-mall committed Dec 14, 2020
1 parent a87b5a8 commit f5a0539
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public String login(@RequestParam("userName") String userName,
//session.setMaxInactiveInterval(60 * 60 * 2);
return "redirect:/admin/index";
} else {
session.setAttribute("errorMsg", "登陆失败,请联系作者获得测试账号");
session.setAttribute("errorMsg", "登录失败");
return "admin/login";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ public void mallKaptcha(HttpServletRequest httpServletRequest, HttpServletRespon
properties.put("kaptcha.border", "no");
properties.put("kaptcha.textproducer.font.color", "27,174,171");
properties.put("kaptcha.noise.color", "20,33,42");
properties.put("kaptcha.textproducer.font.size", "30");
properties.put("kaptcha.textproducer.font.size", "36");
properties.put("kaptcha.image.width", "110");
properties.put("kaptcha.image.height", "40");
properties.put("kaptcha.session.key", Constants.MALL_VERIFY_CODE_KEY);
properties.put("kaptcha.textproducer.char.space", "2");
properties.put("kaptcha.textproducer.char.length", "6");
properties.put("kaptcha.textproducer.char.length", "4");
Config config = new Config(properties);
newBeeMallLoginKaptcha.setConfig(config);
byte[] captchaOutputStream = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Object handleException(Exception e, HttpServletRequest req) {
result.setMessage(e.getMessage());
} else {
e.printStackTrace();
result.setMessage("未知异常,请联系管理员");
result.setMessage("未知异常");
}
//检查请求是否为ajax, 如果是 ajax 请求则返回 Result json串, 如果不是 ajax 请求则返回 error 视图
String contentTypeHeader = req.getHeader("Content-Type");
Expand All @@ -47,7 +47,7 @@ public Object handleException(Exception e, HttpServletRequest req) {
modelAndView.addObject("url", req.getRequestURL());
modelAndView.addObject("stackTrace", e.getStackTrace());
modelAndView.addObject("author", "十三");
modelAndView.addObject("ltd", "新峰商城");
modelAndView.addObject("ltd", "新蜂商城");
modelAndView.setViewName("error/error");
return modelAndView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,12 @@ function categoryEdit() {
}

/**
* 分类的删除会牵涉到多级分类的修改和商品数据的修改,因此暂时就不开放删除功能了
* 分类的删除会牵涉到多级分类的修改和商品数据的修改,请谨慎删除分类数据
* 如果在商城页面不想显示相关分类可以通过调整rank值来调整显示顺序,
* 不过代码我也写了一部分,如果想保留删除功能的话可以在此代码的基础上进行修改。
*/
function deleteCagegory() {
swal("未开放", {
icon: "warning",
});
return;

var ids = getSelectedRows();
if (ids == null) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/mall/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
return false;
}
var verifyCode = $("#verifyCode").val();
if (!validLength(verifyCode, 7)) {
if (!validLength(verifyCode, 5)) {
swal('请输入正确的验证码', {
icon: "error",
});
Expand Down
9 changes: 1 addition & 8 deletions src/main/resources/templates/mall/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@
<script th:src="@{/admin/plugins/sweetalert/sweetalert.min.js}"></script>
<script type="text/javascript">

//部署时未开发注册方法
function register2() {
swal('未开放,请联系作者获得测试账号', {
icon: "error",
});
}

//注册按钮onclick事件改为register()即可
function register() {
var loginName = $("#loginName").val();
Expand All @@ -82,7 +75,7 @@
return false;
}
var verifyCode = $("#verifyCode").val();
if (!validLength(verifyCode, 7)) {
if (!validLength(verifyCode, 5)) {
swal('请输入正确的验证码', {
icon: "error",
});
Expand Down

0 comments on commit f5a0539

Please sign in to comment.