|
|
@@ -12,7 +12,9 @@ import org.springframework.web.bind.annotation.PutMapping;
|
|
12
|
12
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
13
|
13
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
14
|
14
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
15
|
+import com.ruoyi.common.core.constant.Constants;
|
|
15
|
16
|
import com.ruoyi.common.core.constant.UserConstants;
|
|
|
17
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
16
|
18
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
17
|
19
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
18
|
20
|
import com.ruoyi.common.log.annotation.Log;
|
|
|
@@ -96,6 +98,11 @@ public class SysMenuController extends BaseController
|
|
96
|
98
|
{
|
|
97
|
99
|
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
|
98
|
100
|
}
|
|
|
101
|
+ else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
|
|
102
|
+ && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
|
|
|
103
|
+ {
|
|
|
104
|
+ return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
|
|
105
|
+ }
|
|
99
|
106
|
menu.setCreateBy(SecurityUtils.getUsername());
|
|
100
|
107
|
return toAjax(menuService.insertMenu(menu));
|
|
101
|
108
|
}
|
|
|
@@ -112,6 +119,11 @@ public class SysMenuController extends BaseController
|
|
112
|
119
|
{
|
|
113
|
120
|
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
|
114
|
121
|
}
|
|
|
122
|
+ else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
|
|
123
|
+ && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
|
|
|
124
|
+ {
|
|
|
125
|
+ return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
|
|
126
|
+ }
|
|
115
|
127
|
menu.setUpdateBy(SecurityUtils.getUsername());
|
|
116
|
128
|
return toAjax(menuService.updateMenu(menu));
|
|
117
|
129
|
}
|