You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
630 B
Java
24 lines
630 B
Java
package com.manage.service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpSession;
|
|
import java.util.HashMap;
|
|
|
|
/**
|
|
* @author 谢铭
|
|
* @date 2021/9/29
|
|
* 注销之前的session,修复之前的bug
|
|
* 触发条件:同一浏览器打开登录页
|
|
*/
|
|
|
|
@Service
|
|
public class LoginService {
|
|
public void removeOldUserOnLogin(HttpServletRequest request) {
|
|
if (null != request.getSession(false)&&!"".equals(request.getSession(false))) {
|
|
//直接注销之前session
|
|
request.getSession(false).invalidate();
|
|
}
|
|
}
|
|
} |