From ac0a4071e8b520bcfb99d7de2e3195675e786cab Mon Sep 17 00:00:00 2001 From: xiangwb Date: Mon, 2 Apr 2018 11:40:56 +0800 Subject: [PATCH] merge --- .../DispatcherServletConfig.java | 13 --------- .../controller/sys/IndexController.java | 27 +++++++++---------- .../xwbing/controller/sys/SysUserControl.java | 2 +- .../java/com/xwbing/shiro/ShiroConfig.java | 5 ++-- boot-web/src/main/resources/static/404.html | 10 ------- .../src/main/resources/static/sucess.html | 10 ------- 6 files changed, 15 insertions(+), 52 deletions(-) delete mode 100644 boot-web/src/main/resources/static/404.html delete mode 100644 boot-web/src/main/resources/static/sucess.html diff --git a/boot-web/src/main/java/com/xwbing/configuration/DispatcherServletConfig.java b/boot-web/src/main/java/com/xwbing/configuration/DispatcherServletConfig.java index c7334b3..b1adb9c 100644 --- a/boot-web/src/main/java/com/xwbing/configuration/DispatcherServletConfig.java +++ b/boot-web/src/main/java/com/xwbing/configuration/DispatcherServletConfig.java @@ -21,19 +21,6 @@ import java.util.List; */ @Configuration public class DispatcherServletConfig extends WebMvcConfigurerAdapter { - /*** - * 添加拦截器 - * @param registry - */ - @Override - public void addInterceptors(InterceptorRegistry registry) { - //拦截器1:登录判断 -// registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**"); -// registry.addInterceptor(new LoginInterceptor()) -// .addPathPatterns("/**").excludePathPatterns("/user/login", "/servlet/captchaCode", "/swagger-ui.html"); - //拦截器2... - super.addInterceptors(registry); - } /** * 配置静态访问资源 diff --git a/boot-web/src/main/java/com/xwbing/controller/sys/IndexController.java b/boot-web/src/main/java/com/xwbing/controller/sys/IndexController.java index 8801243..b62b572 100644 --- a/boot-web/src/main/java/com/xwbing/controller/sys/IndexController.java +++ b/boot-web/src/main/java/com/xwbing/controller/sys/IndexController.java @@ -1,9 +1,6 @@ package com.xwbing.controller.sys; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; /** * 项目名称: boot-module-demo @@ -14,16 +11,16 @@ import org.springframework.web.servlet.ModelAndView; @Controller public class IndexController { - @RequestMapping("/login") - public ModelAndView login() { - return new ModelAndView("login"); - } - @GetMapping("/unauthor") - public String unauthor() { - return "redirect:login"; - } - @GetMapping("/index") - public String index() { - return "suecess.html"; - } +// @RequestMapping("/login") +// public ModelAndView login() { +// return new ModelAndView("login"); +// } +// @GetMapping("/unauthor") +// public String unauthor() { +// return "redirect:login"; +// } +// @GetMapping("/index") +// public String index() { +// return "suecess.html"; +// } } diff --git a/boot-web/src/main/java/com/xwbing/controller/sys/SysUserControl.java b/boot-web/src/main/java/com/xwbing/controller/sys/SysUserControl.java index 48f736f..3bcdf14 100644 --- a/boot-web/src/main/java/com/xwbing/controller/sys/SysUserControl.java +++ b/boot-web/src/main/java/com/xwbing/controller/sys/SysUserControl.java @@ -159,7 +159,7 @@ public class SysUserControl { return JsonResult.toJSONObj("没有获取到用户登录信息"); } - @LogInfo("当前用修改密码") + @LogInfo("当前用户修改密码") @ApiOperation(value = "当前用户修改密码", response = RestMessageVo.class) @PostMapping("updatePassWord") public JSONObject updatePassWord(@RequestParam String newPassWord, @RequestParam String oldPassWord) { diff --git a/boot-web/src/main/java/com/xwbing/shiro/ShiroConfig.java b/boot-web/src/main/java/com/xwbing/shiro/ShiroConfig.java index 6464ad3..2602ab1 100644 --- a/boot-web/src/main/java/com/xwbing/shiro/ShiroConfig.java +++ b/boot-web/src/main/java/com/xwbing/shiro/ShiroConfig.java @@ -36,9 +36,8 @@ public class ShiroConfig { ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); shiroFilterFactoryBean.setSecurityManager(securityManager()); //如果不设置默认会自动寻找Web工程根目录下的"/login.jsp"页面 - shiroFilterFactoryBean.setLoginUrl("/login"); - shiroFilterFactoryBean.setSuccessUrl("/index"); - shiroFilterFactoryBean.setUnauthorizedUrl("/redirect:unauthor"); + shiroFilterFactoryBean.setLoginUrl("/login.html"); + shiroFilterFactoryBean.setUnauthorizedUrl("/login.html"); Map chains = new LinkedHashMap<>(); //静态资源 chains.put("/META-INF/resources/**", "anon"); diff --git a/boot-web/src/main/resources/static/404.html b/boot-web/src/main/resources/static/404.html deleted file mode 100644 index ea2f1a3..0000000 --- a/boot-web/src/main/resources/static/404.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Welcome to the world - - -

404

- - \ No newline at end of file diff --git a/boot-web/src/main/resources/static/sucess.html b/boot-web/src/main/resources/static/sucess.html deleted file mode 100644 index 32d0556..0000000 --- a/boot-web/src/main/resources/static/sucess.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - seccess - - -

seccess

- - \ No newline at end of file