diff --git a/backend/src/main/java/io/metersphere/config/ShiroConfig.java b/backend/src/main/java/io/metersphere/config/ShiroConfig.java index 92d723b810..f668f89d8e 100644 --- a/backend/src/main/java/io/metersphere/config/ShiroConfig.java +++ b/backend/src/main/java/io/metersphere/config/ShiroConfig.java @@ -14,11 +14,13 @@ import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.ApplicationContext; +import org.springframework.context.EnvironmentAware; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; +import org.springframework.core.env.Environment; import javax.servlet.DispatcherType; import javax.servlet.Filter; @@ -27,7 +29,8 @@ import java.util.Map; import java.util.Objects; @Configuration -public class ShiroConfig { +public class ShiroConfig implements EnvironmentAware { + private Environment env; @Bean public ShiroFilterFactoryBean getShiroFilterFactoryBean(DefaultWebSecurityManager sessionManager) { @@ -115,9 +118,11 @@ public class ShiroConfig { @Bean public SessionManager sessionManager(MemoryConstrainedCacheManager memoryConstrainedCacheManager) { + Long sessionTimeout = env.getProperty("session.timeout", Long.class, 1800L); // 默认1800s, 半个小时 + DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); sessionManager.setSessionIdUrlRewritingEnabled(false); - sessionManager.setGlobalSessionTimeout(1800000L); + sessionManager.setGlobalSessionTimeout(sessionTimeout * 1000);// 超时时间ms sessionManager.setDeleteInvalidSessions(true); sessionManager.setSessionValidationSchedulerEnabled(true); SimpleCookie sessionIdCookie = new SimpleCookie(); @@ -137,4 +142,9 @@ public class ShiroConfig { ShiroDBRealm shiroDBRealm = (ShiroDBRealm) context.getBean("shiroDBRealm"); ((DefaultWebSecurityManager) context.getBean("securityManager")).setRealm(shiroDBRealm); } + + @Override + public void setEnvironment(Environment environment) { + this.env = environment; + } } diff --git a/frontend/src/business/components/performance/report/components/LogDetails.vue b/frontend/src/business/components/performance/report/components/LogDetails.vue index 3dcc9e8fe0..6c2307328b 100644 --- a/frontend/src/business/components/performance/report/components/LogDetails.vue +++ b/frontend/src/business/components/performance/report/components/LogDetails.vue @@ -3,7 +3,7 @@ {{$t('load_test.download_log_file')}} diff --git a/frontend/src/business/components/settings/SettingMenu.vue b/frontend/src/business/components/settings/SettingMenu.vue index d58d04ab40..cc3fd00952 100644 --- a/frontend/src/business/components/settings/SettingMenu.vue +++ b/frontend/src/business/components/settings/SettingMenu.vue @@ -29,7 +29,8 @@ {{$t('commons.workspace')}} {{$t('commons.member')}} - {{$t('test_track.plan_view.report_template')}} + {{$t('test_track.plan_view.report_template')}} + @@ -38,7 +39,9 @@ {{$t('commons.personal_info')}} {{$t('commons.personal_setting')}} - API Keys + API Keys + diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index 11220863f9..b735db6b2e 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -32,6 +32,7 @@ {{ scope.row.createTime | timestampFormatDate }} +