fix: Gateway Token验证修复

1. Gateway Redis database 改为 0(与业务服务一致)
2. TokenInfo 添加 @JsonIgnoreProperties(ignoreUnknown = true)
3. TokenInfo.isExpired() 添加 @JsonIgnore 避免序列化
4. isExpired() 方法增加 null 检查
This commit is contained in:
zhangjf 2026-02-20 18:52:54 +08:00
parent 52c926dcd6
commit 44e7efdfc0
18 changed files with 35 additions and 30 deletions

View File

@ -1,4 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Fri Feb 20 18:33:58 CST 2026
#Fri Feb 20 18:51:03 CST 2026
fund-common-0.0.1-SNAPSHOT.jar>=
fund-common-0.0.1-SNAPSHOT.pom>=

View File

@ -3,7 +3,7 @@
<groupId>com.fundplatform</groupId>
<artifactId>fund-common</artifactId>
<versioning>
<lastUpdated>20260220103348</lastUpdated>
<lastUpdated>20260220105100</lastUpdated>
<snapshot>
<localCopy>true</localCopy>
</snapshot>
@ -11,12 +11,12 @@
<snapshotVersion>
<extension>pom</extension>
<value>0.0.1-SNAPSHOT</value>
<updated>20260220103348</updated>
<updated>20260220105100</updated>
</snapshotVersion>
<snapshotVersion>
<extension>jar</extension>
<value>0.0.1-SNAPSHOT</value>
<updated>20260220103348</updated>
<updated>20260220105100</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>

View File

@ -6,6 +6,6 @@
<versions>
<version>0.0.1-SNAPSHOT</version>
</versions>
<lastUpdated>20260220103348</lastUpdated>
<lastUpdated>20260220105100</lastUpdated>
</versioning>
</metadata>

View File

@ -1,3 +1,3 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Fri Feb 20 18:33:50 CST 2026
#Fri Feb 20 18:51:01 CST 2026
fundplatform-0.0.1-SNAPSHOT.pom>=

View File

@ -3,7 +3,7 @@
<groupId>com.fundplatform</groupId>
<artifactId>fundplatform</artifactId>
<versioning>
<lastUpdated>20260220103348</lastUpdated>
<lastUpdated>20260220105100</lastUpdated>
<snapshot>
<localCopy>true</localCopy>
</snapshot>
@ -11,7 +11,7 @@
<snapshotVersion>
<extension>pom</extension>
<value>0.0.1-SNAPSHOT</value>
<updated>20260220103348</updated>
<updated>20260220105100</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>

View File

@ -6,6 +6,6 @@
<versions>
<version>0.0.1-SNAPSHOT</version>
</versions>
<lastUpdated>20260220103348</lastUpdated>
<lastUpdated>20260220105100</lastUpdated>
</versioning>
</metadata>

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008125
#Fri Feb 20 18:45:42 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584342966

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008166
#Fri Feb 20 18:45:42 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584342984

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008178
#Fri Feb 20 18:45:43 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584343003

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008176
#Fri Feb 20 18:45:43 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584343001

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008171
#Fri Feb 20 18:45:42 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584342991

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008165
#Fri Feb 20 18:45:42 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584342979

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008180
#Fri Feb 20 18:45:43 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584343012

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008169
#Fri Feb 20 18:45:42 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584342989

View File

@ -1,2 +1,2 @@
#Fri Feb 20 18:40:08 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584008173
#Fri Feb 20 18:45:42 CST 2026
central|https\://repo1.maven.org/maven2|null=1771584342997

View File

@ -1,11 +1,15 @@
package com.fundplatform.common.auth;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.io.Serializable;
/**
* Token信息实体
* 存储在Redis中的用户会话信息
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class TokenInfo implements Serializable {
private static final long serialVersionUID = 1L;
@ -89,7 +93,8 @@ public class TokenInfo implements Serializable {
/**
* 检查Token是否过期
*/
@JsonIgnore
public boolean isExpired() {
return System.currentTimeMillis() > expireTime;
return expireTime != null && System.currentTimeMillis() > expireTime;
}
}

View File

@ -5,13 +5,13 @@ spring:
application:
name: fund-gateway
# Redis配置(用于限流)
# Redis配置(用于限流和Token验证)
data:
redis:
host: localhost
port: 6379
password: zjf@123456
database: 1
database: 0
cloud:
compatibility-verifier: