【fix sonar】 IndexController.java文件
This commit is contained in:
+12
-14
@@ -8,10 +8,7 @@ import org.springframework.beans.propertyeditors.CustomDateEditor;
|
|||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -45,10 +42,9 @@ public class IndexController {
|
|||||||
@RequestMapping("/chartInfo")
|
@RequestMapping("/chartInfo")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ReturnT<Map<String, Object>> chartInfo(Date startDate, Date endDate) {
|
public ReturnT<Map<String, Object>> chartInfo(Date startDate, Date endDate) {
|
||||||
ReturnT<Map<String, Object>> chartInfo = xxlJobService.chartInfo(startDate, endDate);
|
return xxlJobService.chartInfo(startDate, endDate);
|
||||||
return chartInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/toLogin")
|
@RequestMapping("/toLogin")
|
||||||
@PermissionLimit(limit=false)
|
@PermissionLimit(limit=false)
|
||||||
public String toLogin(HttpServletRequest request, HttpServletResponse response) {
|
public String toLogin(HttpServletRequest request, HttpServletResponse response) {
|
||||||
@@ -57,22 +53,24 @@ public class IndexController {
|
|||||||
}
|
}
|
||||||
return "login";
|
return "login";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value="login", method=RequestMethod.POST)
|
// @RequestMapping(value="login", method=RequestMethod.POST)
|
||||||
|
@PostMapping("login")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PermissionLimit(limit=false)
|
@PermissionLimit(limit=false)
|
||||||
public ReturnT<String> loginDo(HttpServletRequest request, HttpServletResponse response, String userName, String password, String ifRemember){
|
public ReturnT<String> loginDo(HttpServletRequest request, HttpServletResponse response, String userName, String password, String ifRemember){
|
||||||
boolean ifRem = (ifRemember!=null && ifRemember.trim().length()>0 && "on".equals(ifRemember))?true:false;
|
boolean ifRem = ifRemember!=null && ifRemember.trim().length()>0 && "on".equals(ifRemember);
|
||||||
return loginService.login(request, response, userName, password, ifRem);
|
return loginService.login(request, response, userName, password, ifRem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value="logout", method=RequestMethod.POST)
|
// @RequestMapping(value="logout", method=RequestMethod.POST)
|
||||||
|
@PostMapping("logout")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PermissionLimit(limit=false)
|
@PermissionLimit(limit=false)
|
||||||
public ReturnT<String> logout(HttpServletRequest request, HttpServletResponse response){
|
public ReturnT<String> logout(HttpServletRequest request, HttpServletResponse response){
|
||||||
return loginService.logout(request, response);
|
return loginService.logout(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/help")
|
@RequestMapping("/help")
|
||||||
public String help() {
|
public String help() {
|
||||||
|
|
||||||
@@ -89,5 +87,5 @@ public class IndexController {
|
|||||||
dateFormat.setLenient(false);
|
dateFormat.setLenient(false);
|
||||||
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
|
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user