| | |
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | |
| | | {
|
| | | return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
| | | }
|
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
| | | && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
|
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
| | | {
|
| | | return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
| | | }
|
| | |
| | | {
|
| | | return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
| | | }
|
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
| | | && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
|
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
| | | {
|
| | | return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
| | | return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
| | | }
|
| | | else if (menu.getMenuId().equals(menu.getParentId()))
|
| | | {
|
| | | return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
| | | return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
| | | }
|
| | | menu.setUpdateBy(SecurityUtils.getUsername());
|
| | | return toAjax(menuService.updateMenu(menu));
|