微服务 教程
1085个小节阅读:195.5k
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
在本项目中,我们使用Spring Security
进行认证和授权,首先我们先编写相关页面。
编写登录页面admin_login.html
xxxxxxxxxx
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>登录</title>
<th:block th:replace="/backstage/common_resources::common_css"></th:block>
<th:block th:replace="/backstage/common_resources::common_js"></th:block>
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="all-admin-index.html"><b>旅游网</b>后台管理系统</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">登录系统</p>
<form action="all-admin-index.html" method="get">
<div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="用户名">
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" placeholder="密码">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<!-- /.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>
$(function() {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
</body>
</html>
编写登录失败页面admin_fail.html
xxxxxxxxxx
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>登录失败</title>
<th:block th:replace="/backstage/common_resources::common_css"></th:block>
<th:block th:replace="/backstage/common_resources::common_js"></th:block>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div class="wrapper">
<div class="content-wrapper">
<h2>用户名或密码错误,请<a href="/backstage/admin_login">重新登录</a></h2>
</div>
</div>
<footer th:replace="~{/backstage/common_footer::footer}"></footer>
</body>
</html>
编写权限不足页面no_permission.html
xxxxxxxxxx
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>权限不足</title>
<th:block th:replace="/backstage/common_resources::common_css"></th:block>
<th:block th:replace="/backstage/common_resources::common_js"></th:block>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<header th:replace="~{/backstage/common_header::header}"></header>
<aside th:replace="~{/backstage/common_aside::aside}"></aside>
<div class="wrapper">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
403 错误页面
</h1>
<ol class="breadcrumb">
<li><a href="all-admin-index.html"><i class="fa fa-dashboard"></i> 首页</a></li>
<li class="active">403 错误</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="error-page">
<h2 class="headline text-yellow">403</h2>
<div class="error-content">
<h3><i class="fa fa-warning text-yellow"></i>权限不足</h3>
<p>
您的权限不足,请联系管理员添加权限
</p>
</div>
</div>
</section>
</div>
</div>
<footer th:replace="~{/backstage/common_footer::footer}"></footer>
</body>
</html>