mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
Revert "refactor(gateway): 重写is-login方法,不用响应式,防止阻塞redisson线程"
This reverts commit 892b938313
.
This commit is contained in:
parent
e26fe4c417
commit
25bd46830d
@ -1,29 +1,18 @@
|
||||
package io.metersphere.gateway.config;
|
||||
|
||||
import io.metersphere.commons.constants.SessionConstants;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.session.data.redis.RedisSessionRepository;
|
||||
import org.springframework.web.server.session.HeaderWebSessionIdResolver;
|
||||
import org.springframework.web.server.session.WebSessionIdResolver;
|
||||
|
||||
@Configuration
|
||||
public class SessionConfig {
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Bean
|
||||
public WebSessionIdResolver webSessionIdResolver() {
|
||||
HeaderWebSessionIdResolver sessionIdResolver = new HeaderWebSessionIdResolver();
|
||||
sessionIdResolver.setHeaderName(SessionConstants.HEADER_TOKEN); // Define Session Header Name
|
||||
return sessionIdResolver;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisSessionRepository redisSessionRepository() {
|
||||
return new RedisSessionRepository(redisTemplate);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user