From e656d466c2d67ea1e74eec215ec5d06526be11eb Mon Sep 17 00:00:00 2001 From: Xiong Neng Date: Sat, 15 Sep 2018 15:49:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90springboot-shiro=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- springboot-shiro/README.md | 4 ++ springboot-shiro/pom.xml | 3 -- .../src/main/resources/application.yml | 44 +------------------ .../src/main/resources/sql/schema.sql | 4 +- .../src/main/resources/templates/index.html | 13 +++--- 5 files changed, 13 insertions(+), 55 deletions(-) diff --git a/springboot-shiro/README.md b/springboot-shiro/README.md index 51b92c2..a117cce 100644 --- a/springboot-shiro/README.md +++ b/springboot-shiro/README.md @@ -11,6 +11,10 @@ SpringBoot和Shiro集成,实现用户登录认证和授权访问页面。 1. admin/12345678 2. aix/12345678 +根据登录用户的不通角色可以看到不通的菜单 + +admin登录后可以看到用户管理菜单,aix登录后可以看到App管理、机具入网监控等业务系统菜单 + ## 许可证 Copyright (c) 2018 Xiong Neng diff --git a/springboot-shiro/pom.xml b/springboot-shiro/pom.xml index 3e8e2e2..d0311ec 100644 --- a/springboot-shiro/pom.xml +++ b/springboot-shiro/pom.xml @@ -26,9 +26,6 @@ 8.0.7-dmr 2.1.8 1.0.5 - - 3.0.7.RELEASE - 2.2.2 diff --git a/springboot-shiro/src/main/resources/application.yml b/springboot-shiro/src/main/resources/application.yml index 58dade4..0627a47 100644 --- a/springboot-shiro/src/main/resources/application.yml +++ b/springboot-shiro/src/main/resources/application.yml @@ -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 diff --git a/springboot-shiro/src/main/resources/sql/schema.sql b/springboot-shiro/src/main/resources/sql/schema.sql index 8bedfc7..0884795 100644 --- a/springboot-shiro/src/main/resources/sql/schema.sql +++ b/springboot-shiro/src/main/resources/sql/schema.sql @@ -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 '更新时间' diff --git a/springboot-shiro/src/main/resources/templates/index.html b/springboot-shiro/src/main/resources/templates/index.html index b67a1aa..b2bd3fe 100644 --- a/springboot-shiro/src/main/resources/templates/index.html +++ b/springboot-shiro/src/main/resources/templates/index.html @@ -28,26 +28,23 @@
  • - 项目管理 -
  • -
  • - 用户管理 + 用户管理
  • ` - 机具入网管理 + 机具入网管理
  • - 机具状态监控 + 机具状态监控
  • - App管理 + App管理