mirror of
https://gitee.com/wangkang/udf.git
synced 2026-11-01 09:33:43 +00:00
更新
This commit is contained in:
@@ -435,12 +435,17 @@
|
||||
});
|
||||
//注册按钮点击事件
|
||||
$('.header-right-bar-registered-div button').on('click', function () {
|
||||
//跳转到注册页面
|
||||
//打开loading
|
||||
openLoading();
|
||||
//跳转注册界面
|
||||
window.location.href = '/registered.html';
|
||||
});
|
||||
//登陆按钮点击事件
|
||||
$('.header-right-bar-login-div button').on('click', function () {
|
||||
//打开loading
|
||||
openLoading();
|
||||
//获得重定向地址
|
||||
var redirectUrl = escape(window.location.href);
|
||||
//跳转登陆界面
|
||||
window.location.href = '/registered.html?redirectUrl=' + redirectUrl;
|
||||
window.location.href = '/login.html';
|
||||
});
|
||||
});
|
||||
//设置(全局)的AJAX请求默认选项
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<header th:replace="common::head(title='ITKK登陆')"></header>
|
||||
<style lang="css">
|
||||
.registered-card {
|
||||
min-width: 300px;
|
||||
max-width: 400px;
|
||||
margin: auto !important;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div th:include="common::top"></div>
|
||||
<div class="main pre-scrollable">
|
||||
<div class="card registered-card">
|
||||
<div class="card-body">
|
||||
<form class="registered-form">
|
||||
<div class="form-group">
|
||||
<label for="userId">用户名</label>
|
||||
<input type="text" class="form-control form-control-lg" id="userId">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pswd">密码</label>
|
||||
<input type="password" class="form-control form-control-lg" id="pswd">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="button" class="btn btn-success login-btn float-left">登陆</button>
|
||||
<button type="button" class="btn btn-link registered-btn float-right">还没有账号? 点这里注册</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="common::bottom"></div>
|
||||
<div th:include="common::footer"></div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
//页面加载完成
|
||||
$(document).ready(function () {
|
||||
//注册按钮点击事件
|
||||
$('.registered-btn').on('click', function () {
|
||||
//跳转到注册
|
||||
window.location.href = '/registered.html';
|
||||
});
|
||||
//注册按钮点击事件
|
||||
$('.login-btn').on('click', function () {
|
||||
//构造参数
|
||||
var param = {
|
||||
userId: $('#userId').val(),
|
||||
pswd: $('#pswd').val()
|
||||
};
|
||||
//请求
|
||||
$.ajax({
|
||||
url: '/api/udf/web/public/rbac/user/login',
|
||||
type: 'POST',
|
||||
async: true,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
dataType: "json",
|
||||
data: JSON.stringify(param),
|
||||
success: function (data) {
|
||||
if (data.result) {
|
||||
if ('[(${redirectUrl})]') {
|
||||
window.location.href = '[(${redirectUrl})]';
|
||||
} else {
|
||||
window.location.href = '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="button" class="btn btn-success registered-btn float-left">注册</button>
|
||||
<button type="button" class="btn btn-link login-btn float-right">已有账号? 请直接登陆</button>
|
||||
<button type="button" class="btn btn-link login-btn float-right">已有账号? 点这里登陆</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -44,6 +44,11 @@
|
||||
<script type="text/javascript">
|
||||
//页面加载完成
|
||||
$(document).ready(function () {
|
||||
//登陆按钮点击事件
|
||||
$('.login-btn').on('click', function () {
|
||||
//跳转到登陆
|
||||
window.location.href = '/login.html';
|
||||
});
|
||||
//注册按钮点击事件
|
||||
$('.registered-btn').on('click', function () {
|
||||
//构造参数
|
||||
|
||||
Reference in New Issue
Block a user