完成springboot-shiro升级重构
This commit is contained in:
parent
722cdb2e38
commit
e656d466c2
@ -11,6 +11,10 @@ SpringBoot和Shiro集成,实现用户登录认证和授权访问页面。
|
||||
1. admin/12345678
|
||||
2. aix/12345678
|
||||
|
||||
根据登录用户的不通角色可以看到不通的菜单
|
||||
|
||||
admin登录后可以看到用户管理菜单,aix登录后可以看到App管理、机具入网监控等业务系统菜单
|
||||
|
||||
## 许可证
|
||||
|
||||
Copyright (c) 2018 Xiong Neng
|
||||
|
@ -26,9 +26,6 @@
|
||||
<mysql-connector.version>8.0.7-dmr</mysql-connector.version>
|
||||
<mybatis-plus.version>2.1.8</mybatis-plus.version>
|
||||
<mybatisplus-spring-boot-starter.version>1.0.5</mybatisplus-spring-boot-starter.version>
|
||||
<!--以下两项需要如果不配置,解析themleaft 会有问题-->
|
||||
<thymeleaf.version>3.0.7.RELEASE</thymeleaf.version>
|
||||
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -23,10 +23,6 @@ spring:
|
||||
mvc:
|
||||
view:
|
||||
prefix: /templates
|
||||
http:
|
||||
multipart:
|
||||
max-request-size: 100MB #最大请求大小
|
||||
max-file-size: 100MB #最大文件大小
|
||||
|
||||
################### mybatis-plus配置 ###################
|
||||
mybatis-plus:
|
||||
@ -45,10 +41,6 @@ mybatis-plus:
|
||||
lazyLoadingEnabled: true #延时加载的开关
|
||||
multipleResultSetsEnabled: true #开启的话,延时加载一个属性时会加载该对象全部属性,否则按需加载属性
|
||||
|
||||
################### spring security配置 ###################
|
||||
security:
|
||||
ignored: /static/**
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.springframework.web.servlet: ERROR
|
||||
@ -61,7 +53,7 @@ logging:
|
||||
spring:
|
||||
profiles: dev
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
|
||||
url: jdbc:mysql://127.0.0.1:3306/pos?serverTimezone=UTC&useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
|
||||
username: root
|
||||
password: 123456
|
||||
thymeleaf:
|
||||
@ -81,36 +73,4 @@ logging:
|
||||
ROOT: INFO
|
||||
com:
|
||||
xncoding: DEBUG
|
||||
file: E:/logs/app-manage.log
|
||||
|
||||
---
|
||||
|
||||
#####################################################################
|
||||
######################## 测试环境profile ##########################
|
||||
#####################################################################
|
||||
|
||||
spring:
|
||||
profiles: test
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
|
||||
username: root
|
||||
password: 123456
|
||||
thymeleaf:
|
||||
cache: false
|
||||
|
||||
################### 自定义项目配置 ###################
|
||||
xncoding:
|
||||
excel-path: /var/data/
|
||||
files-path: /usr/share/nginx/html/files/
|
||||
files-url-prefix: https://show.xncoding.net/files/ # 文件访问URL前缀
|
||||
pics-path: /usr/share/nginx/html/pics/
|
||||
pics-url-prefix: https://show.xncoding.net/pics/ # 图片访问URL前缀
|
||||
# posapi-url-prefix: http://posapi.enzhico.net
|
||||
posapi-url-prefix: http://127.0.0.1:9095
|
||||
|
||||
logging:
|
||||
level:
|
||||
ROOT: INFO
|
||||
com:
|
||||
xncoding: DEBUG
|
||||
file: /var/logs/app-manage.log
|
||||
file: D:/logs/app-manage.log
|
||||
|
@ -26,7 +26,7 @@ INSERT INTO `t_manager` VALUES (2,'aix','张三','2412d3972722eb186f69a8f4011fbd
|
||||
DROP TABLE IF EXISTS `t_role`;
|
||||
CREATE TABLE `t_role` (
|
||||
`id` INT(11) PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
|
||||
`role` VARCHAR(16) DEFAULT '' COMMENT '角色名称',
|
||||
`role` VARCHAR(64) DEFAULT '' COMMENT '角色名称',
|
||||
`description` VARCHAR(255) DEFAULT '' COMMENT '角色说明',
|
||||
`created_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||
@ -50,7 +50,7 @@ INSERT INTO `t_manager_role` VALUES (2, 2, 2, '2017-05-05 00:00:00','2017-05-05
|
||||
DROP TABLE IF EXISTS `t_permission`;
|
||||
CREATE TABLE `t_permission` (
|
||||
`id` INT(11) PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
|
||||
`permission` VARCHAR(16) DEFAULT '' COMMENT '权限名称',
|
||||
`permission` VARCHAR(64) DEFAULT '' COMMENT '权限名称',
|
||||
`description` VARCHAR(255) DEFAULT '' COMMENT '权限说明',
|
||||
`created_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||
|
@ -28,26 +28,23 @@
|
||||
</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu animated fadeInRight m-t-xs">
|
||||
<li><a th:href="@{/password}">修改密码</a></li>
|
||||
<li><a th:href="@{/}">修改密码</a></li>
|
||||
<li><a href="javascript:void(0);" onclick="logout()">安全退出</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="logo-element"></div>
|
||||
</li>
|
||||
<li shiro:hasRole="admin">
|
||||
<a id="plink" class="J_menuItem" th:href="@{/project/index.html}"><span class="nav-label">项目管理</span></a>
|
||||
</li>
|
||||
<li shiro:hasRole="admin" th:if="${session.projectNum} and (${session.projectNum} gt 0)">
|
||||
<a class="J_menuItem" th:href="@{/user/index.html}"><span class="nav-label">用户管理</span></a>
|
||||
<a class="J_menuItem" th:href="@{/}"><span class="nav-label">用户管理</span></a>
|
||||
</li>
|
||||
<li shiro:lacksRole="admin">`
|
||||
<a class="J_menuItem" th:href="@{/device/index.html}"><span class="nav-label">机具入网管理</span></a>
|
||||
<a class="J_menuItem" th:href="@{/}"><span class="nav-label">机具入网管理</span></a>
|
||||
</li>
|
||||
<li shiro:lacksRole="admin">
|
||||
<a class="J_menuItem" th:href="@{/monitor/index.html}"><span class="nav-label">机具状态监控</span></a>
|
||||
<a class="J_menuItem" th:href="@{/}"><span class="nav-label">机具状态监控</span></a>
|
||||
</li>
|
||||
<li shiro:lacksRole="admin">
|
||||
<a class="J_menuItem" th:href="@{/app/index.html}" data-index="0">App管理</a>
|
||||
<a class="J_menuItem" th:href="@{/}" data-index="0">App管理</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user