|
|
|
@ -16,6 +16,28 @@ |
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|
|
|
<!--<link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>--> |
|
|
|
<style type="text/css">label.error { position:inherit; }</style> |
|
|
|
|
|
|
|
<style> |
|
|
|
.loginbox input.vcsty { |
|
|
|
width: 30%; |
|
|
|
border-bottom: 1px solid #ddd; |
|
|
|
} |
|
|
|
|
|
|
|
.vcode { |
|
|
|
float: right; |
|
|
|
margin-right: 5%; |
|
|
|
width: 54%; |
|
|
|
height: 40px; |
|
|
|
border: 1px solid #eee; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
|
|
|
|
.vcode img { |
|
|
|
width: auto; |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|
</head> |
|
|
|
|
|
|
|
<body> |
|
|
|
@ -31,6 +53,15 @@ |
|
|
|
<input class="pwsty" type="password" placeholder="请输入密码" id="login-password" name="password" /> |
|
|
|
<input class="checksty" name="" type="checkbox" value="" checked="checked" /><span class="remtxt">记住密码</span> |
|
|
|
<!--<a href="#" class="fortxt">忘记密码?</a> --> |
|
|
|
<div class="vcbox" th:if="${captchaEnabled==true}"> |
|
|
|
<div class="inptit">验证码</div> |
|
|
|
<input class="vcsty" type="text" placeholder="请输入验证码" name="validateCode" maxlength="6" autocomplete="off" /> |
|
|
|
<div class="vcode"> |
|
|
|
<a href="javascript:void(0);" title="点击更换验证码"> |
|
|
|
<img th:src="@{captcha/captchaImage(type=${captchaType})}" class="imgcode" width="85%"/> |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="loginbtn" id="login">登录</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -59,6 +90,14 @@ |
|
|
|
<script> |
|
|
|
$(function(){ |
|
|
|
console.log(document.cookie); |
|
|
|
|
|
|
|
$(function() { |
|
|
|
$('.imgcode').click(function() { |
|
|
|
var url = ctx + "captcha/captchaImage?type=" + captchaType + "&s=" + Math.random(); |
|
|
|
$(".imgcode").attr("src", url); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
/*登录*/ |
|
|
|
$("#login").click(function(){ |
|
|
|
login(); |
|
|
|
@ -79,12 +118,14 @@ |
|
|
|
//var rememberMe = false; |
|
|
|
var userName=$("#login-username").val(); |
|
|
|
var passWord=$("#login-password").val(); |
|
|
|
var validateCode=$("[name = 'validateCode']").val(); |
|
|
|
$.ajax({ |
|
|
|
type: "post", |
|
|
|
url: ctx + "login", |
|
|
|
data: { |
|
|
|
"secretName": userName, |
|
|
|
"secretKey": Encrypt(passWord) |
|
|
|
"secretKey": Encrypt(passWord), |
|
|
|
"validateCode": validateCode |
|
|
|
//"rememberMe": rememberMe |
|
|
|
}, |
|
|
|
success: function(r) { |
|
|
|
|