You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
687 B
21 lines
687 B
package com.controller.admin;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
import com.exception.AdminLoginNoException;
|
|
@Controller
|
|
public class BaseController {
|
|
/**
|
|
* 登录权限控制,处理方法执行前执行该方法
|
|
* @throws AdminLoginNoException
|
|
*/
|
|
@ModelAttribute
|
|
public void isLogin(HttpSession session, HttpServletRequest request) throws AdminLoginNoException {
|
|
if(session.getAttribute("auser") == null){
|
|
throw new AdminLoginNoException("没有登录");
|
|
}
|
|
}
|
|
} |