正在显示
110 个修改的文件
包含
96 行增加
和
26 行删除
lib/CL3Export.jar
0 → 100755
不能预览此文件类型
lib/CL3Nonexport.jar
0 → 100755
不能预览此文件类型
lib/FastInfoset-1.2.8.jar
0 → 100755
不能预览此文件类型
lib/HeartbeatService.jar
0 → 100755
不能预览此文件类型
lib/IMFClient.1.0.0.jar
0 → 100755
不能预览此文件类型
lib/ProcessService.jar
0 → 100755
不能预览此文件类型
lib/UploadService.jar
0 → 100755
不能预览此文件类型
lib/XmlSchema-1.4.7.jar
0 → 100755
不能预览此文件类型
lib/antlr-2.7.7.jar
0 → 100755
不能预览此文件类型
lib/antlr-3.2.jar
0 → 100755
不能预览此文件类型
lib/antlr-runtime-3.2.jar
0 → 100755
不能预览此文件类型
lib/aopalliance-1.0.jar
0 → 100755
不能预览此文件类型
lib/apiConfig.jar
0 → 100755
不能预览此文件类型
lib/asm-3.3.jar
0 → 100755
不能预览此文件类型
lib/bcprov-jdk15-1.45.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.axis2.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.commonservices.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.defaultconfig.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.fta.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.headers.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.jmqi.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.jms.Nojndi.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.pcf.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.postcard.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.soap.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mq.tools.ras.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mqetclient.jar
0 → 100755
不能预览此文件类型
lib/com.ibm.mqjms.jar
0 → 100755
不能预览此文件类型
lib/commons-collections-3.2.1.jar
0 → 100755
不能预览此文件类型
lib/commons-lang-2.5.jar
0 → 100755
不能预览此文件类型
lib/commons-logging-1.1.1.jar
0 → 100755
不能预览此文件类型
lib/commons-pool-1.5.5.jar
0 → 100755
不能预览此文件类型
lib/connector.jar
0 → 100755
不能预览此文件类型
lib/cxf-2.3.2.jar
0 → 100755
不能预览此文件类型
lib/cxf-manifest.jar
0 → 100755
不能预览此文件类型
lib/cxf-xjc-boolean-2.3.2.jar
0 → 100755
不能预览此文件类型
lib/cxf-xjc-bug671-2.3.2.jar
0 → 100755
不能预览此文件类型
lib/cxf-xjc-dv-2.3.2.jar
0 → 100755
不能预览此文件类型
lib/cxf-xjc-ts-2.3.2.jar
0 → 100755
不能预览此文件类型
lib/dhbcore.jar
0 → 100755
不能预览此文件类型
lib/fscontext.jar
0 → 100755
不能预览此文件类型
lib/geronimo-activation_1.1_spec-1.1.jar
0 → 100755
不能预览此文件类型
lib/geronimo-annotation_1.0_spec-1.1.1.jar
0 → 100755
不能预览此文件类型
lib/geronimo-javamail_1.4_spec-1.7.1.jar
0 → 100755
不能预览此文件类型
lib/geronimo-jaxws_2.2_spec-1.0.jar
0 → 100755
不能预览此文件类型
lib/geronimo-jms_1.1_spec-1.1.1.jar
0 → 100755
不能预览此文件类型
lib/geronimo-servlet_3.0_spec-1.0.jar
0 → 100755
不能预览此文件类型
lib/geronimo-stax-api_1.0_spec-1.0.1.jar
0 → 100755
不能预览此文件类型
lib/geronimo-ws-metadata_2.0_spec-1.1.3.jar
0 → 100755
不能预览此文件类型
lib/imfmsg.jar
0 → 100755
不能预览此文件类型
lib/jaxb-api-2.2.1.jar
0 → 100755
不能预览此文件类型
lib/jaxb-impl-2.2.1.1.jar
0 → 100755
不能预览此文件类型
lib/jaxb-xjc-2.2.1.1.jar
0 → 100755
不能预览此文件类型
lib/jettison-1.2.jar
0 → 100755
不能预览此文件类型
lib/jetty-continuation-7.2.2.v20101205.jar
0 → 100755
不能预览此文件类型
lib/jetty-http-7.2.2.v20101205.jar
0 → 100755
不能预览此文件类型
lib/jetty-io-7.2.2.v20101205.jar
0 → 100755
不能预览此文件类型
lib/jetty-server-7.2.2.v20101205.jar
0 → 100755
不能预览此文件类型
lib/jetty-util-7.2.2.v20101205.jar
0 → 100755
不能预览此文件类型
lib/jms.jar
0 → 100755
不能预览此文件类型
lib/jndi.jar
0 → 100755
不能预览此文件类型
lib/jra-1.0-alpha-4.jar
0 → 100755
不能预览此文件类型
lib/js-1.7R2.jar
0 → 100755
不能预览此文件类型
lib/jsr173_1.0_api.jar
0 → 100755
不能预览此文件类型
lib/jsr311-api-1.1.1.jar
0 → 100755
不能预览此文件类型
lib/jta.jar
0 → 100755
不能预览此文件类型
lib/ldap.jar
0 → 100755
不能预览此文件类型
lib/log4j-1.2.16.jar
0 → 100755
不能预览此文件类型
lib/neethi-2.0.4.jar
0 → 100755
不能预览此文件类型
lib/oro-2.0.8.jar
0 → 100755
不能预览此文件类型
lib/providerutil.jar
0 → 100755
不能预览此文件类型
lib/resolver.jar
0 → 100755
不能预览此文件类型
lib/returnXml.jar
0 → 100755
不能预览此文件类型
lib/rmm.jar
0 → 100755
不能预览此文件类型
lib/saaj-api-1.3.jar
0 → 100755
不能预览此文件类型
lib/saaj-impl-1.3.2.jar
0 → 100755
不能预览此文件类型
lib/serializer-2.7.1.jar
0 → 100755
不能预览此文件类型
lib/sigar.jar
0 → 100755
不能预览此文件类型
lib/slf4j-api-1.6.1.jar
0 → 100755
不能预览此文件类型
lib/slf4j-jdk14-1.6.1.jar
0 → 100755
不能预览此文件类型
lib/spring-aop-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-asm-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-beans-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-context-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-core-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-expression-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-jms-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-tx-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/spring-web-3.0.5.RELEASE.jar
0 → 100755
不能预览此文件类型
lib/stax2-api-3.0.2.jar
0 → 100755
不能预览此文件类型
lib/stringtemplate-3.2.jar
0 → 100755
不能预览此文件类型
lib/velocity-1.6.4.jar
0 → 100755
不能预览此文件类型
lib/woodstox-core-asl-4.0.8.jar
0 → 100755
不能预览此文件类型
lib/wsdl4j-1.6.2.jar
0 → 100755
不能预览此文件类型
lib/wss4j-1.5.11.jar
0 → 100755
不能预览此文件类型
lib/xalan-2.7.1.jar
0 → 100755
不能预览此文件类型
lib/xbean_xpath.jar
0 → 100755
不能预览此文件类型
lib/xml-resolver-1.2.jar
0 → 100755
不能预览此文件类型
lib/xmlbeans-qname.jar
0 → 100755
不能预览此文件类型
lib/xmlpublic.jar
0 → 100755
不能预览此文件类型
lib/xmlsec-1.4.4.jar
0 → 100755
不能预览此文件类型
| @@ -31,11 +31,11 @@ | @@ -31,11 +31,11 @@ | ||
| 31 | <artifactId>mybatis-spring-boot-starter</artifactId> | 31 | <artifactId>mybatis-spring-boot-starter</artifactId> |
| 32 | <version>1.3.2</version> | 32 | <version>1.3.2</version> |
| 33 | </dependency> | 33 | </dependency> |
| 34 | - <dependency> | ||
| 35 | - <groupId>org.springframework.boot</groupId> | ||
| 36 | - <artifactId>spring-boot-devtools</artifactId> | ||
| 37 | - <optional>true</optional> | ||
| 38 | - </dependency> | 34 | + <!--<dependency>--> |
| 35 | + <!--<groupId>org.springframework.boot</groupId>--> | ||
| 36 | + <!--<artifactId>spring-boot-devtools</artifactId>--> | ||
| 37 | + <!--<optional>true</optional>--> | ||
| 38 | + <!--</dependency>--> | ||
| 39 | <!--有WEBSOCKET包 包含了spring-boot-starter-web 和spring-boot-starter包 有这个包不要引入这俩包--> | 39 | <!--有WEBSOCKET包 包含了spring-boot-starter-web 和spring-boot-starter包 有这个包不要引入这俩包--> |
| 40 | <dependency> | 40 | <dependency> |
| 41 | <groupId>org.springframework.boot</groupId> | 41 | <groupId>org.springframework.boot</groupId> |
| @@ -49,6 +49,11 @@ | @@ -49,6 +49,11 @@ | ||
| 49 | </dependency> | 49 | </dependency> |
| 50 | <dependency> | 50 | <dependency> |
| 51 | <groupId>org.springframework.boot</groupId> | 51 | <groupId>org.springframework.boot</groupId> |
| 52 | + <artifactId>spring-boot-configuration-processor</artifactId> | ||
| 53 | + <optional>true</optional> | ||
| 54 | + </dependency> | ||
| 55 | + <dependency> | ||
| 56 | + <groupId>org.springframework.boot</groupId> | ||
| 52 | <artifactId>spring-boot-starter-thymeleaf</artifactId> | 57 | <artifactId>spring-boot-starter-thymeleaf</artifactId> |
| 53 | </dependency> | 58 | </dependency> |
| 54 | <dependency> | 59 | <dependency> |
| 1 | +package com.tianbo.warehouse.bean; | ||
| 2 | + | ||
| 3 | +import org.springframework.security.core.Authentication; | ||
| 4 | + | ||
| 5 | +import java.io.Serializable; | ||
| 6 | +import java.util.Map; | ||
| 7 | + | ||
| 8 | +public class AuthSuccessResponse implements Serializable{ | ||
| 9 | + | ||
| 10 | + private static final long serialVersionUID = 1L; | ||
| 11 | + | ||
| 12 | + private Authentication authentication; | ||
| 13 | + | ||
| 14 | + private Map<String,Object> loginUserMenus; | ||
| 15 | + | ||
| 16 | + public AuthSuccessResponse (Authentication authentication,Map<String,Object> loginUserMenus){ | ||
| 17 | + this.authentication= authentication; | ||
| 18 | + this.loginUserMenus = loginUserMenus; | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public Authentication getAuthentication() { | ||
| 22 | + return authentication; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public void setAuthentication(Authentication authentication) { | ||
| 26 | + this.authentication = authentication; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public Map<String, Object> getLoginUserMenus() { | ||
| 30 | + return loginUserMenus; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public void setLoginUserMenus(Map<String, Object> loginUserMenus) { | ||
| 34 | + this.loginUserMenus = loginUserMenus; | ||
| 35 | + } | ||
| 36 | +} |
| @@ -44,17 +44,4 @@ public class PermssionController { | @@ -44,17 +44,4 @@ public class PermssionController { | ||
| 44 | } | 44 | } |
| 45 | return resultJson; | 45 | return resultJson; |
| 46 | } | 46 | } |
| 47 | - | ||
| 48 | - @GetMapping("/perm/userMenus") | ||
| 49 | - public Map<String,Object> getLoginUserMenus(){ | ||
| 50 | - | ||
| 51 | - try{ | ||
| 52 | - UserDetails userDetails =(UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); | ||
| 53 | - int i; | ||
| 54 | - }catch (Exception e){ | ||
| 55 | - e.printStackTrace(); | ||
| 56 | - } | ||
| 57 | - Map<String,Object> menuMap = permissionService.getUserMenus(); | ||
| 58 | - return menuMap; | ||
| 59 | - } | ||
| 60 | } | 47 | } |
| 1 | package com.tianbo.warehouse.security.handel; | 1 | package com.tianbo.warehouse.security.handel; |
| 2 | 2 | ||
| 3 | import com.fasterxml.jackson.databind.ObjectMapper; | 3 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 4 | +import com.tianbo.warehouse.bean.AuthSuccessResponse; | ||
| 5 | +import com.tianbo.warehouse.controller.PermssionController; | ||
| 6 | +import com.tianbo.warehouse.model.PERMISSION; | ||
| 7 | +import com.tianbo.warehouse.model.USERS; | ||
| 4 | import com.tianbo.warehouse.security.model.LoginType; | 8 | import com.tianbo.warehouse.security.model.LoginType; |
| 9 | +import com.tianbo.warehouse.service.PermissionService; | ||
| 5 | import org.apache.commons.logging.Log; | 10 | import org.apache.commons.logging.Log; |
| 6 | import org.apache.commons.logging.LogFactory; | 11 | import org.apache.commons.logging.LogFactory; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -19,6 +24,7 @@ import javax.servlet.ServletException; | @@ -19,6 +24,7 @@ import javax.servlet.ServletException; | ||
| 19 | import javax.servlet.http.HttpServletRequest; | 24 | import javax.servlet.http.HttpServletRequest; |
| 20 | import javax.servlet.http.HttpServletResponse; | 25 | import javax.servlet.http.HttpServletResponse; |
| 21 | import java.io.IOException; | 26 | import java.io.IOException; |
| 27 | +import java.util.Map; | ||
| 22 | 28 | ||
| 23 | /** | 29 | /** |
| 24 | * 登录成功后的返回处理 | 30 | * 登录成功后的返回处理 |
| @@ -30,6 +36,8 @@ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticat | @@ -30,6 +36,8 @@ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticat | ||
| 30 | @Autowired | 36 | @Autowired |
| 31 | private ObjectMapper objectMapper; | 37 | private ObjectMapper objectMapper; |
| 32 | 38 | ||
| 39 | + @Autowired | ||
| 40 | + private PermissionService permissionService; | ||
| 33 | private RequestCache requestCache = new HttpSessionRequestCache(); | 41 | private RequestCache requestCache = new HttpSessionRequestCache(); |
| 34 | 42 | ||
| 35 | @Autowired | 43 | @Autowired |
| @@ -42,7 +50,9 @@ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticat | @@ -42,7 +50,9 @@ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticat | ||
| 42 | //将 authention 信息打包成json格式返回 | 50 | //将 authention 信息打包成json格式返回 |
| 43 | response.setContentType("application/json;charset=UTF-8"); | 51 | response.setContentType("application/json;charset=UTF-8"); |
| 44 | response.setHeader("Access-Control-Allow-Origin","*"); | 52 | response.setHeader("Access-Control-Allow-Origin","*"); |
| 45 | - response.getWriter().write(objectMapper.writeValueAsString(authentication)); | 53 | + USERS loginedUser = (USERS) authentication.getPrincipal(); |
| 54 | + Map<String,Object> menuMap = permissionService.getUserMenus(loginedUser.getUserId()); | ||
| 55 | + response.getWriter().write(objectMapper.writeValueAsString(new AuthSuccessResponse(authentication,menuMap))); | ||
| 46 | }else { | 56 | }else { |
| 47 | //走原来的处理流程 | 57 | //走原来的处理流程 |
| 48 | SavedRequest savedRequest = this.requestCache.getRequest(request, response); | 58 | SavedRequest savedRequest = this.requestCache.getRequest(request, response); |
| @@ -12,5 +12,10 @@ public interface PermissionService { | @@ -12,5 +12,10 @@ public interface PermissionService { | ||
| 12 | 12 | ||
| 13 | int insertSelective(PERMISSION record); | 13 | int insertSelective(PERMISSION record); |
| 14 | 14 | ||
| 15 | - Map<String,Object> getUserMenus(); | 15 | + /** |
| 16 | + * 获取登录用户可访问的权限menus列表 | ||
| 17 | + * @param userId | ||
| 18 | + * @return | ||
| 19 | + */ | ||
| 20 | + Map<String,Object> getUserMenus(Integer userId); | ||
| 16 | } | 21 | } |
| @@ -32,11 +32,11 @@ public class PermissionServiceImp implements PermissionService{ | @@ -32,11 +32,11 @@ public class PermissionServiceImp implements PermissionService{ | ||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | @Override | 34 | @Override |
| 35 | - public Map<String,Object> getUserMenus(){ | 35 | + public Map<String,Object> getUserMenus(Integer userId){ |
| 36 | Map<String,Object> data = new HashMap<String,Object>(); | 36 | Map<String,Object> data = new HashMap<String,Object>(); |
| 37 | try { | 37 | try { |
| 38 | //查询所有菜单 | 38 | //查询所有菜单 |
| 39 | - List<PERMISSION> allMenu = permissionMapper.getAllMenus(); | 39 | + List<PERMISSION> allMenu = permissionMapper.findByUserId(userId); |
| 40 | //根节点 | 40 | //根节点 |
| 41 | List<PERMISSION> rootMenu = new ArrayList<PERMISSION>(); | 41 | List<PERMISSION> rootMenu = new ArrayList<PERMISSION>(); |
| 42 | for (PERMISSION nav : allMenu) { | 42 | for (PERMISSION nav : allMenu) { |
| @@ -32,9 +32,36 @@ | @@ -32,9 +32,36 @@ | ||
| 32 | </select> | 32 | </select> |
| 33 | 33 | ||
| 34 | <select id="getAllMenus" resultMap="BaseResultMap" > | 34 | <select id="getAllMenus" resultMap="BaseResultMap" > |
| 35 | - select | ||
| 36 | - <include refid="Base_Column_List" /> | ||
| 37 | - from permission where ismenu is TRUE ORDER BY permission_order | 35 | + SELECT |
| 36 | + P .* | ||
| 37 | + FROM | ||
| 38 | + permission P | ||
| 39 | + WHERE | ||
| 40 | + P .PERMISSION_ID IN ( | ||
| 41 | + SELECT | ||
| 42 | + RP.permission_id | ||
| 43 | + FROM | ||
| 44 | + ROLE_PERMISSION RP | ||
| 45 | + WHERE | ||
| 46 | + RP.role_id IN ( | ||
| 47 | + SELECT | ||
| 48 | + R.ROLE_ID | ||
| 49 | + FROM | ||
| 50 | + role R | ||
| 51 | + WHERE | ||
| 52 | + R.ROLE_ID IN ( | ||
| 53 | + SELECT | ||
| 54 | + UR.ROLE_ID | ||
| 55 | + FROM | ||
| 56 | + USER_ROLE UR | ||
| 57 | + WHERE | ||
| 58 | + UR.USER_ID = #{userId,jdbcType=INTEGER} AND P.ismenu is TRUE | ||
| 59 | + ) | ||
| 60 | + ) | ||
| 61 | + ) ORDER BY P.permission_order | ||
| 62 | + <!--select--> | ||
| 63 | + <!--<include refid="Base_Column_List" />--> | ||
| 64 | + <!--from permission where ismenu is TRUE ORDER BY permission_order--> | ||
| 38 | </select> | 65 | </select> |
| 39 | <select id="findRoleListByUrl" resultType="java.lang.String" parameterType="java.lang.String"> | 66 | <select id="findRoleListByUrl" resultType="java.lang.String" parameterType="java.lang.String"> |
| 40 | SELECT | 67 | SELECT |
-
请 注册 或 登录 后发表评论