提交 cedfd73e 编写于 作者: sq3536's avatar sq3536

undertow

上级 1a4b70e4
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>org.springframework.boot</groupId> <artifactId>ibizlab-boot-starter-parent</artifactId>
<artifactId>spring-boot-starter-parent</artifactId> <groupId>cn.ibizlab</groupId>
<version>2.4.0</version> <version>2.4.0-SNAPSHOT</version>
<relativePath/> <relativePath>../ibizlab-boot-starter-parent/pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -16,44 +16,6 @@ ...@@ -16,44 +16,6 @@
<description>iBizLab Boot Starter Gateway</description> <description>iBizLab Boot Starter Gateway</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring-boot.version>2.4.0</spring-boot.version>
<spring-cloud.version>2020.0.1</spring-cloud.version>
<spring-cloud-alibaba.version>2021.1</spring-cloud-alibaba.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot,not include plugin
management as the parent import style -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
...@@ -99,6 +61,9 @@ ...@@ -99,6 +61,9 @@
<includes> <includes>
<include>**/**</include> <include>**/**</include>
</includes> </includes>
<excludes>
<exclude>*.jar</exclude>
</excludes>
</resource> </resource>
</resources> </resources>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<swagger3.version>2.1.2</swagger3.version> <swagger3.version>2.1.2</swagger3.version>
<knife4j.version>2.0.9</knife4j.version> <knife4j.version>2.0.9</knife4j.version>
<!--MapStruct高性能属性映射工具--> <!--MapStruct高性能属性映射工具-->
<mapstruct.version>1.3.0.Final</mapstruct.version> <mapstruct.version>1.4.2.Final</mapstruct.version>
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version> <lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
<alibaba-druid.version>1.2.11</alibaba-druid.version> <alibaba-druid.version>1.2.11</alibaba-druid.version>
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId> <artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version> <version>${mapstruct.version}</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
<!--MapStruct高性能属性映射工具--> <!--MapStruct高性能属性映射工具-->
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId> <artifactId>mapstruct</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
......
...@@ -251,6 +251,10 @@ public class AuthenticationUser implements UserDetails ...@@ -251,6 +251,10 @@ public class AuthenticationUser implements UserDetails
AuthenticationUser user = new AuthenticationUser(); AuthenticationUser user = new AuthenticationUser();
user.setUserid(userId); user.setUserid(userId);
user.setPersonname(userName); user.setPersonname(userName);
return setAuthenticationUser(user);
}
public static AuthenticationUser setAuthenticationUser(AuthenticationUser user) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user, null, user.getAuthorities()); UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user, null, user.getAuthorities());
SecurityContextHolder.getContext().setAuthentication(authentication); SecurityContextHolder.getContext().setAuthentication(authentication);
return user; return user;
......
...@@ -45,7 +45,12 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter { ...@@ -45,7 +45,12 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
chain.doFilter(request, response); chain.doFilter(request, response);
return; return;
} }
if(SecurityContextHolder.getContext().getAuthentication() != null){
chain.doFilter(request, response);
return;
}
final String requestHeader = request.getHeader(this.tokenHeader); final String requestHeader = request.getHeader(this.tokenHeader);
String username = null; String username = null;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册