mirror of
https://gitee.com/wangkang/udf.git
synced 2026-11-23 07:43:46 +00:00
更新
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# HTTP
|
||||
spring.http.encoding.enabled=true
|
||||
spring.http.encoding.force=true
|
||||
spring.http.encoding.charset=UTF-8
|
||||
# file encoding
|
||||
spring.mandatory-file-encoding=UTF-8
|
||||
# INFO
|
||||
@@ -16,6 +18,7 @@ info.build.java.target=${java.version}
|
||||
spring.application.name=${project.name}
|
||||
# HTTP SERVER
|
||||
server.port=${server.port}
|
||||
server.tomcat.uri-encoding=UTF-8
|
||||
# compression
|
||||
server.compression.enabled=true
|
||||
server.compression.min-response-size=1KB
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head th:fragment="head">
|
||||
<head th:fragment="head(title)">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"
|
||||
@@ -304,7 +304,7 @@
|
||||
position: inherit;
|
||||
}
|
||||
</style>
|
||||
<title>ITKK</title>
|
||||
<title>[(${title})]</title>
|
||||
</head>
|
||||
<body>
|
||||
<div th:fragment="top">
|
||||
@@ -433,8 +433,16 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
//注册按钮点击事件
|
||||
$('.header-right-bar-registered-div button').on('click', function () {
|
||||
//跳转到注册页面
|
||||
openLoading();
|
||||
//获得重定向地址
|
||||
var redirectUrl = escape(window.location.href);
|
||||
//跳转登陆界面
|
||||
window.location.href = '/registered.html?redirectUrl=' + redirectUrl;
|
||||
});
|
||||
});
|
||||
|
||||
//设置(全局)的AJAX请求默认选项
|
||||
$(function () {
|
||||
$.ajaxSetup({
|
||||
@@ -448,10 +456,28 @@
|
||||
closeLoading();
|
||||
},
|
||||
error: function (xhr) {
|
||||
var content = '服务器开小差了 , 请稍后再试';
|
||||
try {
|
||||
var errorResult = xhr.responseJSON;
|
||||
if (errorResult) {
|
||||
if ('org.springframework.web.bind.MethodArgumentNotValidException' === errorResult.errorDetail.type) {
|
||||
var message = JSON.parse(errorResult.errorDetail.message.replace(/"/g, '"'));
|
||||
var msgBody = '';
|
||||
$.each(message, function (i, item) {
|
||||
msgBody += (i + 1) + ' . ' + item.defaultMessage + '<br />';
|
||||
});
|
||||
content = msgBody;
|
||||
} else {
|
||||
content = errorResult.errorDetail.message;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
$('.toastBox').addToast({
|
||||
showTimeLabel: false,
|
||||
title: '消息',
|
||||
content: '服务器开小差了 , 请稍后再试',
|
||||
content: content,
|
||||
autoHide: true,
|
||||
type: 'info',
|
||||
progress: {show: false},
|
||||
@@ -497,6 +523,34 @@
|
||||
$('.custom-loadding')[0].remove();
|
||||
}
|
||||
}
|
||||
|
||||
//写cookies
|
||||
function setCookie(name, value) {
|
||||
var Days = 30;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
|
||||
//读取cookies
|
||||
function getCookie(name) {
|
||||
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
||||
if (arr === document.cookie.match(reg)) {
|
||||
return unescape(arr[2]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//删除cookies
|
||||
function delCookie(name) {
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() - 1);
|
||||
var cval = getCookie(name);
|
||||
if (cval != null) {
|
||||
document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<header th:replace="common::head"></header>
|
||||
<header th:replace="common::head(title='ITKK首页')"></header>
|
||||
<style lang="css">
|
||||
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<!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" aria-describedby="userIdHelp">
|
||||
<small id="userIdHelp" class="form-text text-muted">需全站唯一</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pswd">密码</label>
|
||||
<input type="password" class="form-control form-control-lg" id="pswd" aria-describedby="pswdHelp">
|
||||
<small id="pswdHelp" class="form-text text-muted">至少6位</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pswdConfim">密码确认</label>
|
||||
<input type="password" class="form-control form-control-lg" id="pswdConfim"
|
||||
aria-describedby="pswdConfimHelp">
|
||||
<small id="pswdConfimHelp" class="form-text text-muted">需和密码一致</small>
|
||||
</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>
|
||||
</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 () {
|
||||
//构造参数
|
||||
var param = {
|
||||
userId: $('#userId').val(),
|
||||
pswd: $('#pswd').val(),
|
||||
pswdConfim: $('#pswdConfim').val(),
|
||||
};
|
||||
//请求
|
||||
$.ajax({
|
||||
url: '/api/udf/web/public/rbac/user/registered',
|
||||
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>
|
||||
Reference in New Issue
Block a user