fix(sign): 缩短签名时间容错与nonce有效期

This commit is contained in:
2026-03-16 10:20:01 +08:00
parent df1113575a
commit e51d3a8e25

View File

@@ -26,10 +26,10 @@ public class SignInterceptor implements HandlerInterceptor {
.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
private final StringRedisTemplate redisTemplate;
// 允许时间误差 5 分钟
private static final long ALLOW_TIME_DIFF_SECONDS = 300;
// 允许时间误差 20秒
private static final long ALLOW_TIME_DIFF_SECONDS = 20;
// nonce 在 Redis 的有效期(建议比时间误差略长一点)
private static final long NONCE_EXPIRE_SECONDS = 300;
private static final long NONCE_EXPIRE_SECONDS = 30;
public SignInterceptor(Map<String, String> appSecretMap,
StringRedisTemplate redisTemplate) {