mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-14 12:32:09 +08:00
#IB1BC9 客户端调用单点注销接口或者maxkey-hmt管理后台页面退出报错:Circular view path [logout]
This commit is contained in:
@@ -41,6 +41,7 @@ import org.springframework.http.MediaType;
|
|||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@@ -65,6 +66,7 @@ public class LogoutEndpoint {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "前端注销接口", description = "前端注销接口",method="GET")
|
@Operation(summary = "前端注销接口", description = "前端注销接口",method="GET")
|
||||||
@GetMapping(value={"/logout"}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
@GetMapping(value={"/logout"}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||||
|
@ResponseBody
|
||||||
public Message<String> logout(@CurrentUser UserInfo currentUser){
|
public Message<String> logout(@CurrentUser UserInfo currentUser){
|
||||||
//if logined in have onlineTicket ,need remove or logout back
|
//if logined in have onlineTicket ,need remove or logout back
|
||||||
String sessionId = currentUser.getSessionId();
|
String sessionId = currentUser.getSessionId();
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@@ -36,6 +38,7 @@ public class LogoutEndpoint {
|
|||||||
SessionManager sessionManager;
|
SessionManager sessionManager;
|
||||||
|
|
||||||
@GetMapping(value={"/logout"})
|
@GetMapping(value={"/logout"})
|
||||||
|
@ResponseBody
|
||||||
public Message<?> logout(HttpServletRequest request,@CurrentUser UserInfo currentUser){
|
public Message<?> logout(HttpServletRequest request,@CurrentUser UserInfo currentUser){
|
||||||
sessionManager.terminate(
|
sessionManager.terminate(
|
||||||
currentUser.getSessionId(),
|
currentUser.getSessionId(),
|
||||||
|
|||||||
Reference in New Issue
Block a user