RBAC权限实战

一、项目结构说明、搭建以及初步验证

引入SSM框架依赖:

<dependencies>                                                              
    <dependency>                                                            
        <groupId>javax.servlet</groupId>                        
        <artifactId>servlet-api</artifactId>                          
        <version>2.5</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>javax.servlet.jsp</groupId>                        
        <artifactId>jsp-api</artifactId>                       
        <version>2.1.3-b06</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.springframework</groupId>                        
        <artifactId>spring-core</artifactId>                          
        <version>4.0.0.RELEASE</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.springframework</groupId>                        
        <artifactId>spring-context</artifactId>                       
        <version>4.0.0.RELEASE</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.springframework</groupId>                        
        <artifactId>spring-jdbc</artifactId>                          
        <version>4.0.0.RELEASE</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.springframework</groupId>                        
        <artifactId>spring-orm</artifactId>                           
        <version>4.0.0.RELEASE</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.springframework</groupId>                        
        <artifactId>spring-web</artifactId>                           
        <version>4.0.0.RELEASE</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.springframework</groupId>                        
        <artifactId>spring-webmvc</artifactId>                        
        <version>4.0.0.RELEASE</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>com.mchange</groupId>                                
        <artifactId>c3p0</artifactId>                                 
        <version>0.9.2</version>                                      
    </dependency>                                                           
    <dependency>                                                            
        <groupId>cglib</groupId>                                      
        <artifactId>cglib</artifactId>                                
        <version>2.2</version>                                        
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.aspectj</groupId>                                
        <artifactId>aspectjweaver</artifactId>                        
        <version>1.6.8</version>                                      
    </dependency>                                                           
                                                                                  
    <!-- Spring整合MyBatis -->                                              
    <!-- MyBatis中延迟加载需要使用Cglib -->                                 
    <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->         
    <dependency>                                                            
        <groupId>org.mybatis</groupId>                                
        <artifactId>mybatis</artifactId>                              
        <version>3.2.8</version>                                      
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.mybatis</groupId>                                
        <artifactId>mybatis-spring</artifactId>                       
        <version>1.2.2</version>                                      
    </dependency>                                                           
                                                                                  
    <!-- 控制日志输出:结合log4j -->                                        
    <dependency>                                                            
        <groupId>log4j</groupId>                                      
        <artifactId>log4j</artifactId>                                
        <version>1.2.17</version>                                     
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.slf4j</groupId>                                  
        <artifactId>slf4j-api</artifactId>                            
        <version>1.7.7</version>                                      
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.slf4j</groupId>                                  
        <artifactId>slf4j-log4j12</artifactId>                        
        <version>1.7.7</version>                                      
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>mysql</groupId>                                      
        <artifactId>mysql-connector-java</artifactId>                 
        <version>5.1.37</version>                                     
    </dependency>                                                           
    <dependency>                                                            
        <groupId>jstl</groupId>                                       
        <artifactId>jstl</artifactId>                                 
        <version>1.2</version>                                        
    </dependency>                                                           
                                                                                  
    <!-- ********其他****************************** -->                     
                                                                                  
    <!-- Ehcache二级缓存 -->                                                
    <dependency>                                                            
        <groupId>net.sf.ehcache</groupId>                             
        <artifactId>ehcache</artifactId>                              
        <version>1.6.2</version>                                      
    </dependency>                                                           
                                                                                  
                                                                                  
    <!-- 石英调度 - 开始 -->                                                
    <dependency>                                                            
        <groupId>org.quartz-scheduler</groupId>                       
        <artifactId>quartz</artifactId>                               
        <version>1.8.5</version>                                      
    </dependency>                                                           
    <dependency>                                                            
        <groupId>org.springframework</groupId>                        
        <artifactId>spring-context-support</artifactId>               
        <version>4.0.0.RELEASE</version>                              
    </dependency>                                                           
    <dependency>                                                            
        <groupId>commons-collections</groupId>                        
        <artifactId>commons-collections</artifactId>                  
        <version>3.1</version>                                        
    </dependency>                                                           
    <!-- 石英调度 - 结束 -->                                                
                                                                                  
    <dependency>                                                            
        <groupId>org.codehaus.jackson</groupId>                       
        <artifactId>jackson-mapper-asl</artifactId>                   
        <version>1.9.2</version>                                      
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.apache.poi</groupId>                             
        <artifactId>poi</artifactId>                                  
        <version>3.9</version>                                        
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.jfree</groupId>                                  
        <artifactId>jfreechart</artifactId>                           
        <version>1.0.19</version>                                     
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>commons-fileupload</groupId>                         
        <artifactId>commons-fileupload</artifactId>                   
        <version>1.3.1</version>                                      
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.freemarker</groupId>                             
        <artifactId>freemarker</artifactId>                           
        <version>2.3.19</version>                                     
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.activiti</groupId>                               
        <artifactId>activiti-engine</artifactId>                      
        <version>5.15.1</version>                                     
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.activiti</groupId>                               
        <artifactId>activiti-spring</artifactId>                      
        <version>5.15.1</version>                                     
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.apache.commons</groupId>                         
        <artifactId>commons-email</artifactId>                        
        <version>1.3.1</version>                                      
    </dependency>                                                           
                                                                                  
    <dependency>                                                            
        <groupId>org.activiti</groupId>                               
        <artifactId>activiti-explorer</artifactId>                    
        <version>5.15.1</version>                                     
        <exclusions>                                                        
            <exclusion>                                                     
                <artifactId>groovy-all</artifactId>                   
                <groupId>org.codehaus.groovy</groupId>                
            </exclusion>                                                    
        </exclusions>                                                       
    </dependency>                                                           
</dependencies> 

二、登录功能

页面原型:

三、用户名称和退出系统

主页面原型代码:

<!DOCTYPE html>
<html lang="GB18030">
  <head>
    <meta charset="GB18030">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/main.css">
    <style>
    .tree li {
        list-style-type: none;
        cursor:pointer;
    }
    .tree-closed {
        height : 40px;
    }
    .tree-expanded {
        height : auto;
    }
    </style>
  </head>

  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container-fluid">
        <div class="navbar-header">
          <div><a class="navbar-brand" style="font-size:32px;" href="#">众筹平台 - 控制面板</a></div>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li style="padding-top:8px;">
                <div class="btn-group">
                  <button type="button" class="btn btn-default btn-success dropdown-toggle" data-toggle="dropdown">
                    <i class="glyphicon glyphicon-user"></i> 张三 <span class="caret"></span>
                  </button>
                      <ul class="dropdown-menu" role="menu">
                        <li><a href="#"><i class="glyphicon glyphicon-cog"></i> 个人设置</a></li>
                        <li><a href="#"><i class="glyphicon glyphicon-comment"></i> 消息</a></li>
                        <li class="divider"></li>
                        <li><a href="index.html"><i class="glyphicon glyphicon-off"></i> 退出系统</a></li>
                      </ul>
                </div>
            </li>
            <li style="margin-left:10px;padding-top:8px;">
                <button type="button" class="btn btn-default btn-danger">
                  <span class="glyphicon glyphicon-question-sign"></span> 帮助
                </button>
            </li>
          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="查询">
          </form>
        </div>
      </div>
    </nav>
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <div class="tree">
                <ul style="padding-left:0px;" class="list-group">
                    <li class="list-group-item tree-closed" >
                        <a href="main.html"><i class="glyphicon glyphicon-dashboard"></i> 控制面板</a> 
                    </li>
                    <li class="list-group-item tree-closed">
                        <span><i class="glyphicon glyphicon glyphicon-tasks"></i> 权限管理 <span class="badge" style="float:right">3</span></span> 
                        <ul style="margin-top:10px;display:none;">
                            <li style="height:30px;">
                                <a href="user.html"><i class="glyphicon glyphicon-user"></i> 用户维护</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="role.html"><i class="glyphicon glyphicon-king"></i> 角色维护</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="permission.html"><i class="glyphicon glyphicon-lock"></i> 许可维护</a> 
                            </li>
                        </ul>
                    </li>
                    <li class="list-group-item tree-closed">
                        <span><i class="glyphicon glyphicon-ok"></i> 业务审核 <span class="badge" style="float:right">3</span></span> 
                        <ul style="margin-top:10px;display:none;">
                            <li style="height:30px;">
                                <a href="auth_cert.html"><i class="glyphicon glyphicon-check"></i> 实名认证审核</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="auth_adv.html"><i class="glyphicon glyphicon-check"></i> 广告审核</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="auth_project.html"><i class="glyphicon glyphicon-check"></i> 项目审核</a> 
                            </li>
                        </ul>
                    </li>
                    <li class="list-group-item tree-closed">
                        <span><i class="glyphicon glyphicon-th-large"></i> 业务管理 <span class="badge" style="float:right">7</span></span> 
                        <ul style="margin-top:10px;display:none;">
                            <li style="height:30px;">
                                <a href="cert.html"><i class="glyphicon glyphicon-picture"></i> 资质维护</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="type.html"><i class="glyphicon glyphicon-equalizer"></i> 分类管理</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="process.html"><i class="glyphicon glyphicon-random"></i> 流程管理</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="advertisement.html"><i class="glyphicon glyphicon-hdd"></i> 广告管理</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="message.html"><i class="glyphicon glyphicon-comment"></i> 消息模板</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="project_type.html"><i class="glyphicon glyphicon-list"></i> 项目分类</a> 
                            </li>
                            <li style="height:30px;">
                                <a href="tag.html"><i class="glyphicon glyphicon-tags"></i> 项目标签</a> 
                            </li>
                        </ul>
                    </li>
                    <li class="list-group-item tree-closed" >
                        <a href="param.html"><i class="glyphicon glyphicon-list-alt"></i> 参数管理</a> 
                    </li>
                </ul>
            </div>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h1 class="page-header">控制面板</h1>

          <div class="row placeholders">
            <div class="col-xs-6 col-sm-3 placeholder">
              <img data-src="holder.js/200x200/auto/sky" class="img-responsive" alt="Generic placeholder thumbnail">
              <h4>Label</h4>
              <span class="text-muted">Something else</span>
            </div>
            <div class="col-xs-6 col-sm-3 placeholder">
              <img data-src="holder.js/200x200/auto/vine" class="img-responsive" alt="Generic placeholder thumbnail">
              <h4>Label</h4>
              <span class="text-muted">Something else</span>
            </div>
            <div class="col-xs-6 col-sm-3 placeholder">
              <img data-src="holder.js/200x200/auto/sky" class="img-responsive" alt="Generic placeholder thumbnail">
              <h4>Label</h4>
              <span class="text-muted">Something else</span>
            </div>
            <div class="col-xs-6 col-sm-3 placeholder">
              <img data-src="holder.js/200x200/auto/vine" class="img-responsive" alt="Generic placeholder thumbnail">
              <h4>Label</h4>
              <span class="text-muted">Something else</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <script src="jquery/jquery-2.1.1.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="script/docs.min.js"></script>
        <script type="text/javascript">
            $(function () {
                $(".list-group-item").click(function(){
                    // jquery对象的回调方法中的this关键字为DOM对象
                    // $(DOM) ==> JQuery
                    if ( $(this).find("ul") ) { // 3 li
                        $(this).toggleClass("tree-closed");
                        if ( $(this).hasClass("tree-closed") ) {
                            $("ul", this).hide("fast");
                        } else {
                            $("ul", this).show("fast");
                        }
                    }
                });
            });
        </script>
  </body>
</html>

四、权限模型简介

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/27156.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【算法-力扣】72. 编辑距离(动态规划)

目录 一、题目描述 二、解题思路 三、参考答案 一、题目描述 编辑距离 给你两个单词 word1 和 word2&#xff0c; 请返回将 word1 转换成 word2 所使用的最少操作数 。 你可以对一个单词进行如下三种操作&#xff1a; 插入一个字符 删除一个字符 替换一个字符 示例 1&#…

解析FTP服务器:从基础知识到vsftpd实战操作

✨✨ 欢迎大家来访Srlua的博文&#xff08;づ&#xffe3;3&#xffe3;&#xff09;づ╭❤&#xff5e;✨✨ &#x1f31f;&#x1f31f; 欢迎各位亲爱的读者&#xff0c;感谢你们抽出宝贵的时间来阅读我的文章。 我是Srlua小谢&#xff0c;在这里我会分享我的知识和经验。&am…

组合和外观模式

文章目录 组合模式1.引出组合模式1.院系展示需求2.组合模式基本介绍3.组合模式原理类图4.解决的问题 2.组合模式解决院系展示1.类图2.代码实现1.AbsOrganizationComponent.java 总体抽象类用于存储信息和定义方法2.University.java 第一层&#xff0c;University 可以管理 Coll…

商城系统如何选型?

近日&#xff0c;拼多多发布618百亿补贴活动首周战报。5月19日活动启动一周内&#xff0c;百亿补贴商家参与数量相比去年618首周增长逾90%。其中&#xff0c;农产品商家同比增长83%&#xff0c;数码家电商家同比增长86%&#xff0c;美妆商家同比增长105%。 作为一家成立还不到1…

python中装饰器的用法

最近发现装饰器是一个非常有意思的东西&#xff0c;很高级&#xff01; 允许你在不修改函数或类的源代码的情况下&#xff0c;为它们添加额外的功能或修改它们的行为。装饰器本质上是一个接受函数作为参数的可调用对象&#xff08;通常是函数或类&#xff09;&#xff0c;并返…

uaGate SI自动化状态监测和工业4.0解决方案

克劳斯玛菲集团&#xff08;于2016年被中国化工集团公司收购&#xff09;为其注塑和反应/挤出系统采用了uaGate SI网关技术并实行了开放且独立于平台的OPC UA标准&#xff0c;以用于设备状态自动化监控&#xff0c;这大大提高了产量并避免了机器停机问题。 自动化状态监测提高了…

文件操作学不懂,小代老师带你深入理解文件操作(下卷)

文件操作学不懂&#xff0c;小代老师带你深入理解文件操作下卷 6. ⽂件的随机读写6.1 fseek6.2 ftell6.3 rewind 7. ⽂件读取结束的判定7.1 被错误使⽤的 feof 8. ⽂件缓冲区 6. ⽂件的随机读写 6.1 fseek 根据⽂件指针的位置和偏移量来定位⽂件指针&#xff08;⽂件内容的光…

Golang使用讯飞星火AI接口

一、API申请 https://www.bilibili.com/video/BV1Yw411m7Rs/?spm_id_from333.337.search-card.all.click&vd_source707ec8983cc32e6e065d5496a7f79ee6 注册申请&#xff0c;需要在此页面获取appid、apisecret、apikey https://www.xfyun.cn/ https://console.xfyun.cn/ser…

wsl子系统ubuntu20.04 设置docker服务开机自启动

docker在重要性毋庸置疑。掌握虚拟化必备工具。大家个人都会有台式机&#xff0c;那么windows的wsl子系统ubuntu应该都会开启来熟悉linux分布式开发。docker是客服OS限制的有利工具。那就开始准备docker环境吧。 docker安装 docker安装前建议apt-get源换国内源。这个题目太多…

Python----多线程使用

在运行代码的时候&#xff0c;总会想让程序同时运行几个东西&#xff0c;这个时候就需要用到多线程。可以说使用python中的threading库来实现多线程&#xff0c;多线程运行的具体线程数量和每个线程的执行时间由操作系统的调度策略决定。 比如我现在需要同时发起请求&#xff…

2024.6.14KMP算法学习记录

目录 一、学习视频 二、跟练代码 主要是想起到一个记录的作用 一、学习视频 【最浅显易懂的 KMP 算法讲解】 https://www.bilibili.com/video/BV1AY4y157yL/?share_sourcecopy_web&vd_sourcedc0e55cfae3b304619670a78444fd795 二、跟练代码 代码来自视频 # KMP算法…

android用Retrofit进行网络请求和解析

Retrofit 的原理 Retrofit的核心原理包括动态代理与Service Method的构建、注解解析与请求配置、网络请求执行与响应处理等。它是一个类型安全的HTTP客户端&#xff0c;用于Android和Java平台&#xff0c;通过将HTTP API转化为Java接口的方式&#xff0c;简化了网络请求的编写…

VMware Workerstation开启虚拟机后,产生乱码名称日志文件

问题情况 如下图所示&#xff0c;我的虚拟机版本是16.1.2版本&#xff0c;每次在启动虚拟机之后&#xff0c;D盘目录下都会产生一个如图下所示的乱码名称文件。同时&#xff0c;虚拟机文件目录也是杂乱不堪&#xff0c;没有按照一台虚拟机对应一个文件夹的形式存在。 问题处理…

机器,学习没有捷径

1 捷径学习 1.1 你捷径学习了么 深度学习因为其优异的学习能力&#xff0c;已经成为推动人工智能发展当之无愧的主力军。深度学习在NLP和CV等不同的场景下都展现了优异的能力。但深度学习也存在一个与生俱来的问题&#xff1a;捷径学习。 捷径学习中的捷径表示的是一种有缺陷…

Solr 日志系统7.4.0部署和迁移到本地,Core Admin 添加新的core报错

文章目录 Solr部署Docker部署二进制部署 Tips:Solr设置账号密码方法1&#xff1a;(不使用)方法2&#xff1a; Core Admin 添加新的core报错Solr数据迁移 Solr部署 Docker部署 docker run -d -p 8983:8983 --name solr solr:latest docker run -d -p 8983:8983 -v /opt/solr:/…

深入探索热门开源项目:技术与社区的魅力

在开源的世界里&#xff0c;每个项目都如同一个独特的星辰&#xff0c;闪耀着智慧与创意的光芒。今天&#xff0c;我为大家带来几个我近期深入探索并深感魅力的热门开源项目&#xff0c;让我们一起感受它们的技术与社区的独特魅力。 1. Flutter 项目简介&#xff1a; Flutter…

QT QByteArray 的用法

QByteArray 是 Qt 中用于处理原始字节数据的类&#xff0c;类似于标准库中的 std::vector<char> 或 std::string&#xff0c;但具有更多适合Qt框架的功能。它可以用来处理文本和二进制数据&#xff0c;并提供了一些方便的方法进行数据操作。下面是一些常见的用法示例&…

学会python——密码加密(python实例四)

目录 1、认识Python 2、环境与工具 2.1 python环境 2.2 Visual Studio Code编译 3、对输入的字符加密 3.1 代码构思 3.2 代码示例 3.3 运行结果 4、总结 1、认识Python Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。 Python 的设计具有很强…

Hexapod C-887使用手册 -- 4,5,6

4 - 拆包 小心拆包C-887 根据合同和发货注意比较发货范围的内容&#xff1a; 检查危险符号的内容。如果任何零件损坏或缺失&#xff0c;立即联系客服部门。 保存所有包装材料&#xff0c;以防产品需要返厂。 5 - 安装 本章中 安装一般注意 安装PC软件 确保通风 接地C-…

vue reduce 求和

Number(j / dataCategory.value[i].data.reduce((x,y)>xy) * 100).toFixed(0)