From 525c3567ae235a8671637d521042701f66b04581 Mon Sep 17 00:00:00 2001
From: zhengjie <201507802@qq.com>
Date: Thu, 20 Jun 2019 17:36:25 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=9B=BE=E5=BD=A2=E9=AA=8C?=
=?UTF-8?q?=E8=AF=81=E7=A0=81=E5=B7=A5=E5=85=B7=EF=BC=8C=E5=85=B6=E4=BB=96?=
=?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../security/rest/AuthenticationController.java | 2 --
.../zhengjie/modules/system/rest/MenuController.java | 6 ++++++
.../modules/system/rest/PermissionController.java | 6 ++++++
.../zhengjie/modules/system/rest/RoleController.java | 12 ++++++++++++
.../zhengjie/modules/system/rest/UserController.java | 9 +++++++++
5 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthenticationController.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthenticationController.java
index b9362139..baf99159 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthenticationController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthenticationController.java
@@ -2,8 +2,6 @@ package me.zhengjie.modules.security.rest;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.IdUtil;
-import com.wf.captcha.Captcha;
-import com.wf.captcha.SpecCaptcha;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.aop.log.Log;
import me.zhengjie.exception.BadRequestException;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java
index dca2c700..aa61f7ac 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java
@@ -81,6 +81,9 @@ public class MenuController {
@PutMapping(value = "/menus")
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_EDIT')")
public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu resources){
+ if (resources.getId() <= new Long(39).longValue()) {
+ throw new BadRequestException("演示环境不可操作");
+ }
menuService.update(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@@ -89,6 +92,9 @@ public class MenuController {
@DeleteMapping(value = "/menus/{id}")
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_DELETE')")
public ResponseEntity delete(@PathVariable Long id){
+ if (id.longValue() <= new Long(39).longValue()) {
+ throw new BadRequestException("演示环境不可操作");
+ }
List