|
|
@@ -1,13 +1,7 @@
|
|
|
package com.izouma.awesomeadmin.web;
|
|
|
|
|
|
-import org.apache.shiro.SecurityUtils;
|
|
|
-import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
|
-import org.apache.shiro.subject.Subject;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -20,18 +14,6 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
@Controller
|
|
|
public class MainController {
|
|
|
|
|
|
-
|
|
|
-// @RequestMapping(value = "/index", method = RequestMethod.GET)
|
|
|
-// @ResponseBody
|
|
|
-// public ModelAndView home() {
|
|
|
-// return new ModelAndView("redirect:/admin");
|
|
|
-// }
|
|
|
-
|
|
|
- @RequestMapping("/index")
|
|
|
- public ModelAndView index(HttpServletRequest request) {
|
|
|
- return new ModelAndView("html/index.html");
|
|
|
- }
|
|
|
-
|
|
|
@RequestMapping("/")
|
|
|
public ModelAndView autoIndex(HttpServletRequest request) {
|
|
|
return new ModelAndView("html/admin.html");
|
|
|
@@ -39,16 +21,6 @@ public class MainController {
|
|
|
|
|
|
@RequestMapping("/admin")
|
|
|
public ModelAndView admin(HttpServletRequest request) {
|
|
|
- Subject subject = SecurityUtils.getSubject();
|
|
|
- if (subject.hasRole("admin")) {
|
|
|
- return new ModelAndView("html/admin.html");
|
|
|
- } else {
|
|
|
- return new ModelAndView("redirect:/loginAdmin");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping("/loginAdmin")
|
|
|
- public ModelAndView loginAdmin(HttpServletRequest request) {
|
|
|
- return new ModelAndView("html/loginAdmin.html");
|
|
|
+ return new ModelAndView("html/admin.html");
|
|
|
}
|
|
|
}
|