api 테스터 세션 연장 추가
This commit is contained in:
@@ -2,13 +2,16 @@ package com.eactive.httpmockserver.login.controller;
|
||||
|
||||
import com.eactive.httpmockserver.user.service.UserService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -61,14 +64,10 @@ public class LoginController {
|
||||
*
|
||||
* @return result - String
|
||||
*/
|
||||
@GetMapping(value = "/refreshSessionTimeout.do")
|
||||
public ModelAndView refreshSessionTimeout(@RequestParam Map<String, Object> commandMap) {
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
modelAndView.addObject("result", "ok");
|
||||
|
||||
return modelAndView;
|
||||
@GetMapping(value = "/refreshSessionTimeout.do", produces = "text/html;charset=utf-8")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> refreshSessionTimeout(@RequestParam Map<String, Object> commandMap) {
|
||||
return ResponseEntity.ok("success");
|
||||
}
|
||||
|
||||
@GetMapping("/actionLogout.do")
|
||||
|
||||
@@ -275,7 +275,16 @@
|
||||
<th:block layout:fragment="contentScript">
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
const timer = setInterval(function () {
|
||||
$.ajax({
|
||||
url: '/refreshSessionTimeout.do',
|
||||
type: 'GET',
|
||||
contentType: 'application/json',
|
||||
complete: function () {
|
||||
controller.hideLoadingOverlay();
|
||||
}
|
||||
});
|
||||
}, 60000);
|
||||
let apiRequests = [];
|
||||
let collections = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user