|
@@ -6,14 +6,7 @@ import com.ruoyi.common.annotation.Anonymous;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.constant.UserConstants;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
@@ -129,6 +122,22 @@ public class SysMenuController extends BaseController {
|
|
|
return toAjax(menuService.deleteMenuById(menuId));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量删除菜单
|
|
|
+ */
|
|
|
+ @Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/removeBatch")
|
|
|
+ public AjaxResult removeBatch(@RequestParam("menuIds") List<String> menuIds) {
|
|
|
+ if(menuService.hasChildByMenuIdBatchRemove(menuIds)){
|
|
|
+ return warn("当前选择的菜单中、存在子菜单,不允许删除");
|
|
|
+ }
|
|
|
+ if(menuService.checkMenuExistRoleBatchRemove(menuIds)){
|
|
|
+ return warn("当前选择的菜单中、菜单已分配,不允许删除");
|
|
|
+ }
|
|
|
+ return toAjax(menuService.batchDeleteMenuByIds(menuIds));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 动态表格获取菜单
|
|
|
*/
|