From eb384365ff29b359e644f38df570d046c7d38177 Mon Sep 17 00:00:00 2001 From: qi Date: Thu, 2 Apr 2020 15:05:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E6=84=8F=E4=B9=89=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lq/cms/web/FileSystemController.java | 2 -- .../java/com/lq/cms/web/IndexController.java | 1 - .../java/com/lq/cms/web/LoginController.java | 11 ++++----- .../com/lq/cms/web/sys/MenuController.java | 2 +- .../lq/cms/web/sys/PermissionController.java | 8 +++---- .../com/lq/cms/web/sys/RoleController.java | 23 +++++++++++-------- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/lq/cms/web/FileSystemController.java b/src/main/java/com/lq/cms/web/FileSystemController.java index c35f9d0..b556502 100755 --- a/src/main/java/com/lq/cms/web/FileSystemController.java +++ b/src/main/java/com/lq/cms/web/FileSystemController.java @@ -28,8 +28,6 @@ import java.util.Date; public class FileSystemController extends BaseController{ public static final Logger LOGGER = LoggerFactory.getLogger(FileSystemController.class); -// @Autowired -// private SysFileService sysFileService; public static final String UPLOAD_FILE_PATH="/Users/qi_liang/java/fileManger"; diff --git a/src/main/java/com/lq/cms/web/IndexController.java b/src/main/java/com/lq/cms/web/IndexController.java index 2dcef35..e17ccc3 100755 --- a/src/main/java/com/lq/cms/web/IndexController.java +++ b/src/main/java/com/lq/cms/web/IndexController.java @@ -50,7 +50,6 @@ public class IndexController { @RequestMapping(value = {"/index",""}) public ModelAndView toCmsIndix(ModelAndView modelAndView, HttpServletRequest request){ Subject subject=SecurityUtils.getSubject(); - Session session = subject.getSession(); SysUser sysUser=(SysUser) subject.getPrincipal(); List list ; String contextPath = request.getContextPath(); diff --git a/src/main/java/com/lq/cms/web/LoginController.java b/src/main/java/com/lq/cms/web/LoginController.java index cc8572a..97449b0 100755 --- a/src/main/java/com/lq/cms/web/LoginController.java +++ b/src/main/java/com/lq/cms/web/LoginController.java @@ -16,9 +16,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -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.bind.annotation.*; import javax.imageio.ImageIO; import javax.servlet.http.HttpServletRequest; @@ -41,16 +39,15 @@ public class LoginController extends BaseController{ @Autowired private SysUserService sysUserService; -// @Autowired -// private MailService mailService; - @RequestMapping(value = {"/index",""}) + + @GetMapping(value = {"/index",""}) public String toLogin(){ return "cms/login"; } @ResponseBody - @RequestMapping(value = "/doLogin",method = RequestMethod.POST) + @PostMapping(value = "/doLogin") public Object doLogin(String loginName, String password, HttpSession session,String authCode,Boolean rememberMe){ AjaxResult ajaxResult= this.getAjaxResult(); String strCode=(String) session.getAttribute("strCode"); diff --git a/src/main/java/com/lq/cms/web/sys/MenuController.java b/src/main/java/com/lq/cms/web/sys/MenuController.java index 09282a0..69dfe63 100755 --- a/src/main/java/com/lq/cms/web/sys/MenuController.java +++ b/src/main/java/com/lq/cms/web/sys/MenuController.java @@ -46,8 +46,8 @@ public class MenuController { return modelAndView; } - @RequestMapping("/list") @ResponseBody + @RequestMapping("/list") @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_SELECT) public Object list(SysResourceVo vo){ AdminDataGridParam adminDataGridParam = new AdminDataGridParam<>(); diff --git a/src/main/java/com/lq/cms/web/sys/PermissionController.java b/src/main/java/com/lq/cms/web/sys/PermissionController.java index 96b4796..7759e54 100644 --- a/src/main/java/com/lq/cms/web/sys/PermissionController.java +++ b/src/main/java/com/lq/cms/web/sys/PermissionController.java @@ -57,8 +57,8 @@ public class PermissionController extends BaseController{ return "cms/sys/permission/edit"; } - @RequestMapping("/list") @ResponseBody + @RequestMapping("/list") public Object list(SysPermissionVo vo){ AdminDataGridParam adminDataGridParam = new AdminDataGridParam<>(); adminDataGridParam.setRows(sysPermissionService.findListPage(vo)); @@ -66,8 +66,8 @@ public class PermissionController extends BaseController{ return adminDataGridParam; } - @RequestMapping("/save") @ResponseBody + @RequestMapping("/save") public Object save(SysPermissionVo vo){ AjaxResult ajaxResult = this.getAjaxResult(); SysPermission sysPermission = sysPermissionService.save(vo); @@ -75,8 +75,8 @@ public class PermissionController extends BaseController{ return ajaxResult; } - @RequestMapping("/update") @ResponseBody + @RequestMapping("/update") public Object update(SysPermissionVo vo){ AjaxResult ajaxResult = this.getAjaxResult(); SysPermission sysPermission = sysPermissionService.update(vo); @@ -84,8 +84,8 @@ public class PermissionController extends BaseController{ return ajaxResult; } - @RequestMapping("/delete") @ResponseBody + @RequestMapping("/delete") public Object delete(SysPermissionVo vo){ sysPermissionService.delete(vo.getId()); diff --git a/src/main/java/com/lq/cms/web/sys/RoleController.java b/src/main/java/com/lq/cms/web/sys/RoleController.java index 561b64c..836e727 100755 --- a/src/main/java/com/lq/cms/web/sys/RoleController.java +++ b/src/main/java/com/lq/cms/web/sys/RoleController.java @@ -49,9 +49,11 @@ public class RoleController { return modelAndView; } - @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_SELECT) - @RequestMapping("/list") + + @ResponseBody + @RequestMapping("/list") + @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_SELECT) public Object list(SysRoleVo vo){ AdminDataGridParam adminDataGridParam = new AdminDataGridParam<>(); adminDataGridParam.setTotal(sysRoleService.count(vo)); @@ -78,9 +80,10 @@ public class RoleController { return modelAndView; } - @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_UPDATE) - @RequestMapping("/updatePermission") + @ResponseBody + @RequestMapping("/updatePermission") + @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_UPDATE) public Object updatePermission(@RequestBody List list){ AjaxResult ajaxResult=new AjaxResult(); boolean result=sysRoleResourcePermissionService.updateRolePermission(list); @@ -91,9 +94,9 @@ public class RoleController { return ajaxResult; } - @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_INSERT) - @RequestMapping("/save") @ResponseBody + @RequestMapping("/save") + @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_INSERT) public Object save(SysRole sysRole){ Date nowTime = new Date(); AjaxResult ajaxResult = new AjaxResult(true," 保存成功",""); @@ -109,9 +112,9 @@ public class RoleController { return ajaxResult; } - @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_UPDATE) - @RequestMapping("/update") @ResponseBody + @RequestMapping("/update") + @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_UPDATE) public Object update(SysRole sysRole){ AjaxResult ajaxResult = new AjaxResult(true," 保存成功",""); if (sysRole!=null&&sysRole.getId()!=null){ @@ -126,9 +129,9 @@ public class RoleController { return ajaxResult; } - @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_DELETE) - @RequestMapping("/delete") @ResponseBody + @RequestMapping("/delete") + @RequiresPermissions(INDEX_URL+ Constant.PERSSION_MARK+Constant.PERMISSION_DELETE) public Object delte(SysRole sysRole){ AjaxResult ajaxResult=new AjaxResult(); if (sysRole!=null&&sysRole.getId()!=null){