修改配置

This commit is contained in:
jinqiming 2021-06-10 17:49:24 +08:00
parent e4c1eb22c8
commit 3a3398cff7
2 changed files with 149 additions and 5 deletions

View File

@ -16,6 +16,10 @@
<link th:href="@{/css/style.css}" rel="stylesheet"/>
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.3.1}" rel="stylesheet"/>
<link href="/static/css/login.min.css" th:href="@{/css/login.min.css}" rel="stylesheet"/>
<script>
if(window.top!==window.self){alert('未登录或登录超时。请重新登录');window.top.location=window.location};
</script>
</head>
<body id="page-top" class="landing-page no-skin-config">
<div class="navbar-wrapper">
@ -38,7 +42,7 @@
<li><a class="page-scroll" href="#testimonials">获奖</a></li>
<li><a class="page-scroll" href="#pricing">价格</a></li>
<li><a class="page-scroll" href="#contact">联系</a></li>
<li shiro:guest=""><a class="page-scroll" th:href="@{/front/login}">登录</a></li>
<li shiro:guest=""><a data-toggle="modal" class="page-scroll" href="#modal-form">登录</a></li>
<li shiro:user=""><a class="page-scroll" th:href="@{/front/main}">我的主页</a></li>
</ul>
</div>
@ -624,6 +628,47 @@
</div>
</div>
</div>
<div id="modal-form" class="modal fade" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-6 b-r"><h3 class="m-t-none m-b">登录</h3>
<!-- <p>今天登录获得更多经验。</p>-->
<form id="signupForm" autocomplete="off">
<div class="form-group"><!--<label>用户名</label> --><input type="text" name="username" class="form-control uname" placeholder="请输入用户名" /></div>
<div class="form-group"><!--<label>密码</label> --><input type="password" name="password" placeholder="请输入密码" class="form-control pword"></div>
<div class="row m-t form-group" th:if="${captchaEnabled==true}">
<div class="col-xs-6">
<input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5" />
</div>
<div class="col-xs-6">
<a href="javascript:void(0);" title="点击更换验证码">
<img th:src="@{../captcha/captchaImage(type=${captchaType})}" class="imgcode" width="85%"/>
</a>
</div>
</div>
<div class="checkbox-custom form-group" th:classappend="${captchaEnabled==false} ? 'm-t'">
<input type="checkbox" id="rememberme" name="rememberme"> <label for="rememberme">记住我</label>
</div>
<div class="form-group">
<button class="btn btn-sm btn-primary pull-right m-t-n-xs btn-block" id="btnSubmit" data-loading="正在验证登录,请稍后..."><strong>登录</strong></button>
</div>
</form>
</div>
<div class="col-sm-6"><h4>非企业用户?</h4>
<p>您可以创建一个帐户:</p>
<p class="text-center">
<a th:href="@{/register}" target="_blank"><i class="fa fa-sign-in big-icon"></i></a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Mainly scripts -->
@ -635,7 +680,12 @@
<!-- Custom and plugin javascript -->
<script th:src="@{/js/plugins/pace/pace.min.js}"></script>
<script th:src="@{/js/plugins/wow/wow.min.js}"></script>
<script>
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
<script th:inline="javascript">
$(document).ready(function () {
$('body').scrollspy({
@ -687,6 +737,101 @@
// Activate WOW.js plugin for animation on scrol
new WOW().init();
$(function() {
validateKickout();
validateRule();
$('.imgcode').click(function() {
var url = ctx + "captcha/captchaImage?type=" + captchaType + "&s=" + Math.random();
$(".imgcode").attr("src", url);
});
});
$.validator.setDefaults({
submitHandler: function() {
login();
}
});
function login() {
$.modal.loading($("#btnSubmit").data("loading"));
var username = $.common.trim($("input[name='username']").val());
var password = $.common.trim($("input[name='password']").val());
var validateCode = $("input[name='validateCode']").val();
var rememberMe = $("input[name='rememberme']").is(':checked');
$.ajax({
type: "post",
url: ctx + "login",
data: {
"username": username,
"password": password,
"validateCode": validateCode,
"rememberMe": rememberMe
},
success: function(r) {
if (r.code == 0) {
location.href ='/front/main';
} else {
$.modal.closeLoading();
$('.imgcode').click();
$(".code").val("");
$.modal.msg(r.msg);
}
}
});
}
function validateRule() {
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
rules: {
username: {
required: true
},
password: {
required: true
}
},
messages: {
username: {
required: icon + "请输入您的用户名",
},
password: {
required: icon + "请输入您的密码",
}
}
})
}
function validateKickout() {
if (getParam("kickout") == 1) {
layer.alert("<font color='red'>您已在别处登录,请您修改密码或重新登录</font>", {
icon: 0,
title: "系统提示"
},
function(index) {
//关闭弹窗
layer.close(index);
if (top != self) {
top.location = self.location;
} else {
var url  =  location.search;
if (url) {
var oldUrl  = window.location.href;
var newUrl  = oldUrl.substring(0,  oldUrl.indexOf('?'));
self.location  = newUrl;
}
}
});
}
}
function getParam(paramName) {
var reg = new RegExp("(^|&)" + paramName + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
}
</script>
</body>

View File

@ -291,13 +291,12 @@ public class ShiroConfig
//filterChainDefinitionMap.put("/**/*.js.map", "anon");
// filterChainDefinitionMap.put("/**/*.css.map", "anon");
filterChainDefinitionMap.put("/front/**", "anon");
filterChainDefinitionMap.put("/dingTalk/dingFlowRobot", "anon");
// 退出 logout地址shiro去清除session
filterChainDefinitionMap.put("/logout", "logout");
// 不需要拦截的访问
// 不需要拦截的访问 -需要过 captchaValidate拦截
filterChainDefinitionMap.put("/login", "anon,captchaValidate");
filterChainDefinitionMap.put("/front/index", "anon,captchaValidate");
// 注册相关
filterChainDefinitionMap.put("/register", "anon,captchaValidate");
// 系统权限列表