Commit f4e18205 by 袁伟铭

1.0.0

parent 4b7da5ae
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
<artifactId>common-utils</artifactId> <artifactId>xxx-common-utils</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
<artifactId>common-utils</artifactId> <artifactId>xxx-common-utils</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
<artifactId>common-utils</artifactId> <artifactId>xxx-common-utils</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -98,7 +98,10 @@ public class TokenFilter extends GenericFilterBean { ...@@ -98,7 +98,10 @@ public class TokenFilter extends GenericFilterBean {
*/ */
private String resolveToken(HttpServletRequest request) { private String resolveToken(HttpServletRequest request) {
String bearerToken = request.getHeader(properties.getHeader()); String bearerToken = request.getHeader(properties.getHeader());
if (StringUtils.hasText(bearerToken) && bearerToken.startsWith(properties.getTokenStartWith())) { if (StringUtils.hasText(bearerToken)) {
return null;
}
if (bearerToken.startsWith(properties.getTokenStartWith())) {
// 去掉令牌前缀 // 去掉令牌前缀
return bearerToken.replace(properties.getTokenStartWith(), ""); return bearerToken.replace(properties.getTokenStartWith(), "");
} else { } else {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
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>
<artifactId>cloud-backend</artifactId>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
<artifactId>cloud-backend</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -98,7 +98,10 @@ public class TokenFilter extends GenericFilterBean { ...@@ -98,7 +98,10 @@ public class TokenFilter extends GenericFilterBean {
*/ */
private String resolveToken(HttpServletRequest request) { private String resolveToken(HttpServletRequest request) {
String bearerToken = request.getHeader(properties.getHeader()); String bearerToken = request.getHeader(properties.getHeader());
if (StringUtils.hasText(bearerToken) && bearerToken.startsWith(properties.getTokenStartWith())) { if (StringUtils.hasText(bearerToken)) {
return null;
}
if (bearerToken.startsWith(properties.getTokenStartWith())) {
// 去掉令牌前缀 // 去掉令牌前缀
return bearerToken.replace(properties.getTokenStartWith(), ""); return bearerToken.replace(properties.getTokenStartWith(), "");
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment