Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

切换登陆界面为AdminLTE登陆界面 #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion src/main/resources/jeesite.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/jeesite?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=123456
jdbc.password=1234

#mssql database settings
#jdbc.type=mssql
Expand Down
172 changes: 102 additions & 70 deletions src/main/webapp/WEB-INF/views/modules/sys/sysLogin.jsp
Original file line number Diff line number Diff line change
@@ -1,75 +1,107 @@
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
<title>${fns:getConfig('productName')} 登录</title>
<meta name="decorator" content="blank"/>
<style type="text/css">
html,body,table{background-color:#f5f5f5;width:100%;text-align:center;}.form-signin-heading{font-family:Helvetica, Georgia, Arial, sans-serif, 黑体;font-size:36px;margin-bottom:20px;color:#0663a2;}
.form-signin{position:relative;text-align:left;width:300px;padding:25px 29px 29px;margin:0 auto 20px;background-color:#fff;border:1px solid #e5e5e5;
-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05);}
.form-signin .checkbox{margin-bottom:10px;color:#0663a2;} .form-signin .input-label{font-size:16px;line-height:23px;color:#999;}
.form-signin .input-block-level{font-size:16px;height:auto;margin-bottom:15px;padding:7px;*width:283px;*padding-bottom:0;_padding:7px 7px 9px 7px;}
.form-signin .btn.btn-large{font-size:16px;} .form-signin #themeSwitch{position:absolute;right:15px;bottom:10px;}
.form-signin div.validateCode {padding-bottom:15px;} .mid{vertical-align:middle;}
.header{height:80px;padding-top:20px;} .alert{position:relative;width:300px;margin:0 auto;*padding-bottom:0px;}
label.error{background:none;width:270px;font-weight:normal;color:inherit;margin:0;}
</style>
<script type="text/javascript">
$(document).ready(function() {
$("#loginForm").validate({
rules: {
validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}
},
messages: {
username: {required: "请填写用户名."},password: {required: "请填写密码."},
validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
},
errorLabelContainer: "#messageBox",
errorPlacement: function(error, element) {
error.appendTo($("#loginError").parent());
}
});
});
// 如果在框架或在对话框中,则弹出提示并跳转到首页
if(self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0 || $('.jbox').length > 0){
alert('未登录或登录超时。请重新登录,谢谢!');
top.location = "${ctx}";
}
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>${fns:getConfig('productName')} | 登录</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet"
href="${pageContext.servletContext.contextPath}/static/adminlte/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.servletContext.contextPath}/static/adminlte/dist/css/AdminLTE.min.css">
<link rel="stylesheet"
href="${pageContext.servletContext.contextPath}/static/adminlte/plugins/iCheck/square/blue.css">
</head>
<body>
<!--[if lte IE 6]><br/><div class='alert alert-block' style="text-align:left;padding-bottom:10px;"><a class="close" data-dismiss="alert">x</a><h4>温馨提示:</h4><p>你使用的浏览器版本过低。为了获得更好的浏览体验,我们强烈建议您 <a href="http://browsehappy.com" target="_blank">升级</a> 到最新版本的IE浏览器,或者使用较新版本的 Chrome、Firefox、Safari 等。</p></div><![endif]-->
<div class="header">
<div id="messageBox" class="alert alert-error ${empty message ? 'hide' : ''}"><button data-dismiss="alert" class="close">×</button>
<label id="loginError" class="error">${message}</label>
</div>
</div>
<h1 class="form-signin-heading">${fns:getConfig('productName')}</h1>
<form id="loginForm" class="form-signin" action="${ctx}/login" method="post">
<label class="input-label" for="username">登录名</label>
<input type="text" id="username" name="username" class="input-block-level required" value="${username}">
<label class="input-label" for="password">密码</label>
<input type="password" id="password" name="password" class="input-block-level required">
<c:if test="${isValidateCodeLogin}"><div class="validateCode">
<label class="input-label mid" for="validateCode">验证码</label>
<sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
</div></c:if><%--
<label for="mobile" title="手机登录"><input type="checkbox" id="mobileLogin" name="mobileLogin" ${mobileLogin ? 'checked' : ''}/></label> --%>
<input class="btn btn-large btn-primary" type="submit" value="登 录"/>&nbsp;&nbsp;
<label for="rememberMe" title="下次不需要再登录"><input type="checkbox" id="rememberMe" name="rememberMe" ${rememberMe ? 'checked' : ''}/> 记住我(公共场所慎用)</label>
<div id="themeSwitch" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">${fns:getDictLabel(cookie.theme.value,'theme','默认主题')}<b class="caret"></b></a>
<ul class="dropdown-menu">
<c:forEach items="${fns:getDictList('theme')}" var="dict"><li><a href="#" onclick="location='${pageContext.request.contextPath}/theme/${dict.value}?url='+location.href">${dict.label}</a></li></c:forEach>
</ul>
<!--[if lte IE 6]><script type="text/javascript">$('#themeSwitch').hide();</script><![endif]-->
</div>
</form>
<div class="footer">
Copyright &copy; 2012-${fns:getConfig('copyrightYear')} <a href="${pageContext.request.contextPath}${fns:getFrontPath()}">${fns:getConfig('productName')}</a> - Powered By <a href="http://jeesite.com" target="_blank">JeeSite</a> ${fns:getConfig('version')}
</div>
<script src="${ctxStatic}/flash/zoom.min.js" type="text/javascript"></script>
<body class="hold-transition login-page">

<!--[if lte IE 6]><br/>
<div class='alert alert-block' style="text-align:left;padding-bottom:10px;"><a class="close" data-dismiss="alert">x</a>
<h4>温馨提示:</h4>
<p>你使用的浏览器版本过低。为了获得更好的浏览体验,我们强烈建议您 <a href="http://browsehappy.com" target="_blank">升级</a> 到最新版本的IE浏览器,或者使用较新版本的
Chrome、Firefox、Safari 等。</p></div><![endif]-->

<div class="header">
<div id="messageBox" class="alert alert-error ${empty message ? 'hide' : ''}">
<button data-dismiss="alert" class="close">×</button>
<label id="loginError" class="error">${message}</label>
</div>
</div>

<div class="login-box">
<div class="login-logo">
<a href="#"><b>${fns:getConfig('productName')}</b></a>
</div>
<div class="login-box-body">
<p class="login-box-msg">登陆</p>
<form id="loginForm" action="${ctx}/login" method="post">
<div class="form-group has-feedback">
<input name="username" id="username" class="form-control" placeholder="用户名">
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" name="password" id="password" class="form-control"
placeholder="密码">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>

<c:if test="${isValidateCodeLogin}">
<div class="validateCode">
<label class="input-label mid" for="validateCode">验证码</label>
<sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
</div>
</c:if>

<div class="row">
<div class="col-xs-8">
<div class="checkbox icheck" style="margin-left: 20px">
<label>
<input type="checkbox" id="rememberMe" name="rememberMe" ${rememberMe ? 'checked' : ''}/>
记住我
</label>
</div>
</div><!-- /.col -->
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat">登陆</button>
</div><!-- /.col -->
</div>
</form>
</div><!-- /.login-box-body -->
</div><!-- /.login-box -->

<script src="${pageContext.servletContext.contextPath}/static/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/static/adminlte/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/static/adminlte/plugins/iCheck/icheck.min.js"></script>
<script>
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});

$("#loginForm").validate({
rules: {
validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}
},
messages: {
username: {required: "请填写用户名."}, password: {required: "请填写密码."},
validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
},
errorLabelContainer: "#messageBox",
errorPlacement: function (error, element) {
error.appendTo($("#loginError").parent());
}
});
});
// 如果在框架或在对话框中,则弹出提示并跳转到首页
if (self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0 || $('.jbox').length > 0) {
alert('未登录或登录超时。请重新登录,谢谢!');
top.location = "${ctx}";
}
})
;
</script>
</body>
</html>
</html>
10 changes: 10 additions & 0 deletions src/main/webapp/static/adminlte/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.DS_Store
.idea
/nbproject/private/
/nbproject/
/node_modules/
TODO
*.zip
test.html
*.log
test.html
17 changes: 17 additions & 0 deletions src/main/webapp/static/adminlte/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"asi" : true,
"browser" : true,
"eqeqeq" : false,
"eqnull" : true,
"es3" : true,
"expr" : true,
"jquery" : true,
"latedef" : "nofunc",
"laxbreak" : true,
"nonbsp" : true,
"strict" : true,
"undef" : true,
"unused" : true,
// External variabls and plugins
"predef": [ "AdminLTEOptions", "FastClick", "moment", "Morris", "Chart" ]
}
165 changes: 165 additions & 0 deletions src/main/webapp/static/adminlte/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
/*!
* Bootstrap's Gruntfile
* http://getbootstrap.com
* Copyright 2013-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/


module.exports = function (grunt) {

'use strict';

grunt.initConfig({
watch: {
// If any .less file changes in directory "build/less/" run the "less"-task.
files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"],
tasks: ["less", "uglify"]
},
// "less"-task configuration
// This task will compile all less files upon saving to create both AdminLTE.css and AdminLTE.min.css
less: {
// Development not compressed
development: {
options: {
// Whether to compress or not
compress: false
},
files: {
// compilation.css : source.less
"dist/css/AdminLTE.css": "build/less/AdminLTE.less",
//Non minified skin files
"dist/css/skins/skin-blue.css": "build/less/skins/skin-blue.less",
"dist/css/skins/skin-black.css": "build/less/skins/skin-black.less",
"dist/css/skins/skin-yellow.css": "build/less/skins/skin-yellow.less",
"dist/css/skins/skin-green.css": "build/less/skins/skin-green.less",
"dist/css/skins/skin-red.css": "build/less/skins/skin-red.less",
"dist/css/skins/skin-purple.css": "build/less/skins/skin-purple.less",
"dist/css/skins/skin-blue-light.css": "build/less/skins/skin-blue-light.less",
"dist/css/skins/skin-black-light.css": "build/less/skins/skin-black-light.less",
"dist/css/skins/skin-yellow-light.css": "build/less/skins/skin-yellow-light.less",
"dist/css/skins/skin-green-light.css": "build/less/skins/skin-green-light.less",
"dist/css/skins/skin-red-light.css": "build/less/skins/skin-red-light.less",
"dist/css/skins/skin-purple-light.css": "build/less/skins/skin-purple-light.less",
"dist/css/skins/_all-skins.css": "build/less/skins/_all-skins.less"
}
},
// Production compresses version
production: {
options: {
// Whether to compress or not
compress: true
},
files: {
// compilation.css : source.less
"dist/css/AdminLTE.min.css": "build/less/AdminLTE.less",
// Skins minified
"dist/css/skins/skin-blue.min.css": "build/less/skins/skin-blue.less",
"dist/css/skins/skin-black.min.css": "build/less/skins/skin-black.less",
"dist/css/skins/skin-yellow.min.css": "build/less/skins/skin-yellow.less",
"dist/css/skins/skin-green.min.css": "build/less/skins/skin-green.less",
"dist/css/skins/skin-red.min.css": "build/less/skins/skin-red.less",
"dist/css/skins/skin-purple.min.css": "build/less/skins/skin-purple.less",
"dist/css/skins/skin-blue-light.min.css": "build/less/skins/skin-blue-light.less",
"dist/css/skins/skin-black-light.min.css": "build/less/skins/skin-black-light.less",
"dist/css/skins/skin-yellow-light.min.css": "build/less/skins/skin-yellow-light.less",
"dist/css/skins/skin-green-light.min.css": "build/less/skins/skin-green-light.less",
"dist/css/skins/skin-red-light.min.css": "build/less/skins/skin-red-light.less",
"dist/css/skins/skin-purple-light.min.css": "build/less/skins/skin-purple-light.less",
"dist/css/skins/_all-skins.min.css": "build/less/skins/_all-skins.less"
}
}
},
// Uglify task info. Compress the js files.
uglify: {
options: {
mangle: true,
preserveComments: 'some'
},
my_target: {
files: {
'dist/js/app.min.js': ['dist/js/app.js']
}
}
},
// Build the documentation files
includes: {
build: {
src: ['*.html'], // Source files
dest: 'documentation/', // Destination directory
flatten: true,
cwd: 'documentation/build',
options: {
silent: true,
includePath: 'documentation/build/include'
}
}
},

// Optimize images
image: {
dynamic: {
files: [{
expand: true,
cwd: 'build/img/',
src: ['**/*.{png,jpg,gif,svg,jpeg}'],
dest: 'dist/img/'
}]
}
},

// Validate JS code
jshint: {
options: {
jshintrc: '.jshintrc'
},
core: {
src: 'dist/js/app.js'
},
demo: {
src: 'dist/js/demo.js'
},
pages: {
src: 'dist/js/pages/*.js'
}
},

csslint: {
options: {
csslintrc: 'build/less/.csslintrc'
},
dist: [
'dist/css/AdminLTE.css',
]
},

// Delete images in build directory
// After compressing the images in the build/img dir, there is no need
// for them
clean: {
build: ["build/img/*"]
}
});

// Load all grunt tasks

// LESS Compiler
grunt.loadNpmTasks('grunt-contrib-less');
// Watch File Changes
grunt.loadNpmTasks('grunt-contrib-watch');
// Compress JS Files
grunt.loadNpmTasks('grunt-contrib-uglify');
// Include Files Within HTML
grunt.loadNpmTasks('grunt-includes');
// Optimize images
grunt.loadNpmTasks('grunt-image');
// Validate JS code
grunt.loadNpmTasks('grunt-contrib-jshint');
// Delete not needed files
grunt.loadNpmTasks('grunt-contrib-clean');
// Lint CSS
grunt.loadNpmTasks('grunt-contrib-csslint');

// The default task (running "grunt" in console) is "watch"
grunt.registerTask('default', ['watch']);
};
Loading