自定义xss校验注解实现
This commit is contained in:
@ -5,6 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -68,7 +69,7 @@ public class SysNoticeController extends BaseController
|
||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SysNotice notice)
|
||||
public AjaxResult addSave(@Validated SysNotice notice)
|
||||
{
|
||||
notice.setCreateBy(getLoginName());
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
@ -92,7 +93,7 @@ public class SysNoticeController extends BaseController
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(SysNotice notice)
|
||||
public AjaxResult editSave(@Validated SysNotice notice)
|
||||
{
|
||||
notice.setUpdateBy(getLoginName());
|
||||
return toAjax(noticeService.updateNotice(notice));
|
||||
|
Reference in New Issue
Block a user