页面稍微适配下移动端
新增登陆验证码一分钟内只能尝试三次
This commit is contained in:
@@ -9,7 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ToolsApplication {
|
||||
public static final String version="1.0.17";
|
||||
public static final String version="1.0.18";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("当前版本号:"+version);
|
||||
|
||||
@@ -124,8 +124,22 @@ public class userController {
|
||||
|
||||
@RequestMapping(value = "/login/login.do", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String login(HttpServletResponse response, String code) {
|
||||
public String login(HttpServletRequest request,HttpServletResponse response, String code) {
|
||||
JSONObject json = new JSONObject();
|
||||
String ip=Tools.getRemoteAddress(request);
|
||||
if(RedisTools.get(ip)==null||"-999".equals(ip)){
|
||||
RedisTools.set(ip,"1",60);
|
||||
}else{
|
||||
int i=Integer.parseInt(RedisTools.get(ip));
|
||||
if(i!=3){
|
||||
i++;
|
||||
RedisTools.set(ip,i+"",60);
|
||||
}else{
|
||||
json.put("code", -2);
|
||||
json.put("msg", "请求频繁,请稍后再试");
|
||||
return json.toJSONString();
|
||||
}
|
||||
}
|
||||
String secret= (String) ConfigTools.load(ConfigTools.DATA,"secret");
|
||||
if(StringUtils.isEmpty(secret)){
|
||||
secret= (String) ConfigTools.load(ConfigTools.DATA,"secret_tmp");
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
$('#side').load("/html/body/nas/side.html");
|
||||
$.get("/login/check.do", function (data) {
|
||||
let json = JSON.parse(data);
|
||||
if (json.code != 0) {
|
||||
if (json.code !== 0) {
|
||||
window.location.href = "/"
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div id="header"></div>
|
||||
|
||||
<div class="layui-body" style="left: 200px;">
|
||||
<div id="side"></div>
|
||||
<!-- <div id="side"></div>-->
|
||||
|
||||
<div style="margin-left: 2%; margin-top: 2%;">
|
||||
<div>
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
let mobile = navigator.userAgent.toLowerCase().match(/android/i) === "android" || navigator.userAgent.toLowerCase().match(/iphone os/i) === "iphone os";
|
||||
let mobile = layui.device().mobile;
|
||||
if (mobile) {
|
||||
|
||||
$('#myside').removeClass('layui-side')
|
||||
$('#myside_div').removeClass('layui-side-scroll')
|
||||
$('#myside').addClass('layui-header')
|
||||
|
||||
@@ -75,14 +75,16 @@
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
function openLoginCode() {
|
||||
layer.prompt({
|
||||
title: '安全登录码'
|
||||
}, function (value, index, elem) {
|
||||
$.post('/login/login.do', {code: value}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
layer.msg(json.msg)
|
||||
layer.msg(json.msg, function () {
|
||||
window.location.reload()
|
||||
})
|
||||
});
|
||||
layer.close(index);
|
||||
})
|
||||
@@ -106,17 +108,18 @@
|
||||
})
|
||||
})
|
||||
$(document).ready(function () {
|
||||
let mobile = navigator.userAgent.toLowerCase().match(/android/i) === "android" || navigator.userAgent.toLowerCase().match(/iphone os/i) === "iphone os";
|
||||
let mobile = layui.device().mobile;
|
||||
if (mobile) {
|
||||
$('.layui-body').css('left', '0')
|
||||
$('.layui-body').css('top', '150px')
|
||||
$('.layui-body').css('height', '200%')
|
||||
$('#icon').css('float', 'none')
|
||||
|
||||
$('.layui-body').css('position','absolute')
|
||||
|
||||
} else {
|
||||
$('.layui-body').css('padding-right', '100px')
|
||||
$('#icon').css('float', 'right')
|
||||
$('.layui-body').css('position','fixed')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user