Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
T
topology
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
姜立玮
topology
Commits
c1db17dd
提交
c1db17dd
authored
5月 26, 2020
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
限制外链地址必须以http(s)://开头
上级
30be2a08
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
30 行增加
和
2 行删除
+30
-2
Constants.java
ruoyi/src/main/java/com/ruoyi/common/constant/Constants.java
+10
-0
UserConstants.java
...rc/main/java/com/ruoyi/common/constant/UserConstants.java
+7
-1
SysMenuController.java
...om/ruoyi/project/system/controller/SysMenuController.java
+12
-0
SysMenuServiceImpl.java
...ruoyi/project/system/service/impl/SysMenuServiceImpl.java
+1
-1
没有找到文件。
ruoyi/src/main/java/com/ruoyi/common/constant/Constants.java
浏览文件 @
c1db17dd
...
...
@@ -19,6 +19,16 @@ public class Constants
*/
public
static
final
String
GBK
=
"GBK"
;
/**
* http请求
*/
public
static
final
String
HTTP
=
"http://"
;
/**
* https请求
*/
public
static
final
String
HTTPS
=
"https://"
;
/**
* 通用成功标识
*/
...
...
ruoyi/src/main/java/com/ruoyi/common/constant/UserConstants.java
浏览文件 @
c1db17dd
...
...
@@ -26,7 +26,7 @@ public class UserConstants
/** 部门正常状态 */
public
static
final
String
DEPT_NORMAL
=
"0"
;
/** 部门停用状态 */
public
static
final
String
DEPT_DISABLE
=
"1"
;
...
...
@@ -36,6 +36,12 @@ public class UserConstants
/** 是否为系统默认(是) */
public
static
final
String
YES
=
"Y"
;
/** 是否菜单外链(是) */
public
static
final
String
YES_FRAME
=
"0"
;
/** 是否菜单外链(否) */
public
static
final
String
NO_FRAME
=
"1"
;
/** 校验返回结果码 */
public
final
static
String
UNIQUE
=
"0"
;
public
final
static
String
NOT_UNIQUE
=
"1"
;
...
...
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java
浏览文件 @
c1db17dd
...
...
@@ -12,9 +12,11 @@ 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
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.ServletUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.aspectj.lang.annotation.Log
;
import
com.ruoyi.framework.aspectj.lang.enums.BusinessType
;
import
com.ruoyi.framework.security.LoginUser
;
...
...
@@ -100,6 +102,11 @@ public class SysMenuController extends BaseController
{
return
AjaxResult
.
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
}
else
if
(
UserConstants
.
YES_FRAME
.
equals
(
menu
.
getIsFrame
())
&&
!
StringUtils
.
startsWithAny
(
menu
.
getPath
(),
Constants
.
HTTP
,
Constants
.
HTTPS
))
{
return
AjaxResult
.
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,地址必须以http(s)://开头"
);
}
menu
.
setCreateBy
(
SecurityUtils
.
getUsername
());
return
toAjax
(
menuService
.
insertMenu
(
menu
));
}
...
...
@@ -116,6 +123,11 @@ public class SysMenuController extends BaseController
{
return
AjaxResult
.
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
}
else
if
(
UserConstants
.
YES_FRAME
.
equals
(
menu
.
getIsFrame
())
&&
!
StringUtils
.
startsWithAny
(
menu
.
getPath
(),
Constants
.
HTTP
,
Constants
.
HTTPS
))
{
return
AjaxResult
.
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,地址必须以http(s)://开头"
);
}
menu
.
setUpdateBy
(
SecurityUtils
.
getUsername
());
return
toAjax
(
menuService
.
updateMenu
(
menu
));
}
...
...
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysMenuServiceImpl.java
浏览文件 @
c1db17dd
...
...
@@ -298,7 +298,7 @@ public class SysMenuServiceImpl implements ISysMenuService
{
String
routerPath
=
menu
.
getPath
();
// 非外链并且是一级目录
if
(
0
==
menu
.
getParentId
()
&&
"1"
.
equals
(
menu
.
getIsFrame
()))
if
(
0
==
menu
.
getParentId
()
&&
UserConstants
.
NO_FRAME
.
equals
(
menu
.
getIsFrame
()))
{
routerPath
=
"/"
+
menu
.
getPath
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论