<style rel="stylesheet" type="text/css">
#loginDiv {
margin: 50px 0 0 3px;
}
.right-qq {
margin-left: 50px;
}
input {
width: 100px;
}
</style>
<form method="post" action="${ctxPath}/ajax/session" class="am-form" style="display:none;"
id="loginForm">
<div id="loginDiv">
<div class="am-input-group">
<span class="am-input-group-label"><i class="am-icon-envelope-o am-icon-fw"></i></span>
<input type="email" name="email" class="am-form-field" placeholder="邮箱" required>
</div>
<br>
<div class="am-input-group">
<span class="am-input-group-label"><i class="am-icon-lock am-icon-fw"></i></span>
<input type="password" name="password" class="am-form-field" placeholder="密码" required>
</div>
<label for="remember-me">
<input id="remember-me" name="remember" value="1" type="checkbox" checked> 记住密码
</label>
<br/>
<div class="am-cf">
<input type="submit" value="登 录" id="btn" class="am-btn am-btn-primary am-btn-sm am-btn-block am-fl">
</div>
<br>
<div class="am-input-group">
<span class="right-qq"> 其他登录方式</span>
<a href="${ctxPath}/api/qq" class="right-qq"><i class="am-icon-qq am-icon-fw "></i></a>
<a href="${ctxPath}/api/sina" class="right-qq"><i class="am-icon-weibo am-icon-fw"></i></a>
<a href="${ctxPath}/api/github" class="right-qq"><i class="am-icon-github am-icon-fw"></i></a>
<a href="${ctxPath}/api/osc" class="right-qq"><i class="am-icon-git am-icon-fw"></i></a>
<a href="${ctxPath}/api/renren" class="right-qq"><i class="am-icon-renren am-icon-fw"></i></a>
</div>
<br>
<div class="am-cf">
<a href="${ctxPath}" class="am-fr">忘记密码 ^_^ ?</a>
</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function () {
$("#loginForm").submit(function () {
var $form = $("#loginForm");
$.ajax({
url: $form.attr("action"),
type: "post",
dataType: "json",
data: $form.serialize(),
cache: "false",
success: function (data) {
if (data.code === 0) {
layer.msg("登录成功", {shift: 1});
setTimeout(function () {
window.location.href = "${ctxPath}${from!}";
}, 1200);
return true;
} else {
layer.msg(data.message, {shift: 6});
return false;
}
}
});
return false;
});
})
<p>
</script>
</p>
#loginDiv {
margin: 50px 0 0 3px;
}
.right-qq {
margin-left: 50px;
}
input {
width: 100px;
}
</style>
<form method="post" action="/" class="am-form" style=" " id="loginForm">
<div id="loginDiv">
<div class="am-input-group">
<span class="am-input-group-label"><i class="am-icon-envelope-o am-icon-fw"></i></span>
<input type="email" name="email" class="am-form-field" placeholder="邮箱" required>
</div>
<br>
<div class="am-input-group">
<span class="am-input-group-label"><i class="am-icon-lock am-icon-fw"></i></span>
<input type="password" name="password" class="am-form-field" placeholder="密码" required>
</div>
<label for="remember-me">
<input id="remember-me" name="remember" value="1" type="checkbox" checked> 记住密码
</label>
<br/>
<div class="am-cf">
<input type="button" value="登 录" id="btn" class="am-btn am-btn-primary am-btn-sm am-btn-block am-fl">
</div>
<br>
<div class="am-input-group">
<span class="right-qq"> 其他登录方式</span>
<a href="${ctxPath}/api/qq" class="right-qq"><i class="am-icon-qq am-icon-fw "></i></a>
<a href="${ctxPath}/api/sina" class="right-qq"><i class="am-icon-weibo am-icon-fw"></i></a>
<a href="${ctxPath}/api/github" class="right-qq"><i class="am-icon-github am-icon-fw"></i></a>
<a href="${ctxPath}/api/osc" class="right-qq"><i class="am-icon-git am-icon-fw"></i></a>
<a href="${ctxPath}/api/renren" class="right-qq"><i class="am-icon-renren am-icon-fw"></i></a>
</div>
<br>
<div class="am-cf">
<a href="${ctxPath}" class="am-fr">忘记密码 ^_^ ?</a>
</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function () {
$("#btn").click(function () {
console.log('aa');
var $form = $("#loginForm");
$.ajax({
url: $form.attr("action"),
type: "post",
dataType: "json",
data: $form.serialize(),
cache: "false",
success: function (data) {
if (data.code === 0) {
layer.msg("登录成功", {shift: 1});
setTimeout(function () {
window.location.href = "${ctxPath}${from!}";
}, 1200);
return true;
} else {
layer.msg(data.message, {shift: 6});
return false;
}
}
});
return false;
});
})
</script>
</p>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。