parent
c7d78cd045
commit
dbbd02b103
@ -0,0 +1,28 @@
|
|||||||
|
package com.tamguo.web;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
|
import com.tamguo.utils.ShiroUtils;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class LogoutController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注销
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "logout.html", method = RequestMethod.GET)
|
||||||
|
public String logout(HttpServletRequest request, HttpServletResponse response, HttpSession session) {
|
||||||
|
if (session.getAttribute("currMember") != null) {
|
||||||
|
session.removeAttribute("currMember");
|
||||||
|
ShiroUtils.logout();
|
||||||
|
}
|
||||||
|
return "redirect:/";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue