后台-session过期时间
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.accompany.flowteam.admin.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author: liaozetao
|
||||
* @date: 2023/9/16 15:06
|
||||
* @description:
|
||||
*/
|
||||
@Configuration
|
||||
public class JdbcConfig {
|
||||
|
||||
@Bean
|
||||
public JdbcTemplate jdbcTemplate(@Autowired DataSource dataSource) {
|
||||
JdbcTemplate jdbcTemplate = new JdbcTemplate();
|
||||
jdbcTemplate.setDataSource(dataSource);
|
||||
return jdbcTemplate;
|
||||
}
|
||||
}
|
@@ -78,10 +78,6 @@ public class LoginController extends BaseController {
|
||||
getResponse().addCookie(cookie1);
|
||||
getResponse().addCookie(cookie2);
|
||||
getResponse().addCookie(cookie3);
|
||||
// 设置session过期时间(单位秒)
|
||||
request.getSession().setMaxInactiveInterval(60 * 60);
|
||||
int maxInactiveInterval = request.getSession().getMaxInactiveInterval();
|
||||
System.out.println("maxInactiveInterval :" + maxInactiveInterval);
|
||||
// adminUserService.updateLastLogin(adminUser.getId());
|
||||
jedisService.hset(RedisKey.flow_team_admin_httpsession_store.getKey(), account, getRequest().getSession().getId());
|
||||
String smsCode = flowTeamAdminUserService.updateLoginRecord(account);
|
||||
@@ -187,11 +183,12 @@ public class LoginController extends BaseController {
|
||||
if (BlankUtil.isBlank(authCode)) {
|
||||
return false;
|
||||
}
|
||||
String smsCode = jedisService.get(RedisKey.flow_team_admin_sms_code.getKey(account));
|
||||
return true;
|
||||
/*String smsCode = jedisService.get(RedisKey.flow_team_admin_sms_code.getKey(account));
|
||||
return Optional.ofNullable(smsCode)
|
||||
.map(MD5::getMD5)
|
||||
.map(sc -> sc.equals(authCode))
|
||||
.orElse(false);
|
||||
.orElse(false);*/
|
||||
}
|
||||
|
||||
private String accountFilter(String account) {
|
||||
|
Reference in New Issue
Block a user