Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 328e6b4b
由
sunke
编写于
2022-12-16 11:40:28 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
菜单重构
1 个父辈
4554c37b
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
21 行增加
和
4 行删除
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
src/main/java/com/neotel/smfcore/common/utils/PermissionInitUtil.java
src/main/java/com/neotel/smfcore/custom/haman/HamanMenu.java
src/main/java/com/neotel/smfcore/security/rest/MenuController.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
查看文件 @
328e6b4
...
...
@@ -188,10 +188,14 @@ public class MenuInit {
private
void
addDefaultFunctionMenu
(
int
menuSort
,
Menu
parentMenu
,
String
title
,
String
path
,
String
component
,
String
icon
,
String
...
clientLabels
){
Menu
menu
=
Menu
.
createFunctionMenu
(
parentMenu
,
title
,
menuSort
,
path
,
component
,
icon
);
if
(
clientLabels
.
length
==
0
){
addMenu
(
""
,
menu
);
}
else
{
for
(
String
clientLabel
:
clientLabels
)
{
addMenu
(
clientLabel
,
menu
);
}
}
}
protected
void
updateMenu
(
String
[]
menuListToShow
,
String
[]
menuListToHide
){
List
<
Menu
>
dbMenus
=
menuManager
.
findAll
();
...
...
src/main/java/com/neotel/smfcore/common/utils/PermissionInitUtil.java
查看文件 @
328e6b4
...
...
@@ -81,7 +81,7 @@ public class PermissionInitUtil {
if
(
array
.
length
>=
1
&&
permissionSet
.
contains
(
array
[
0
]))
{
}
else
{
log
.
info
(
"未找到权限【"
+
hasP
+
"】"
);
//
log.info("未找到权限【" + hasP + "】");
}
}
}
...
...
src/main/java/com/neotel/smfcore/custom/haman/HamanMenu.java
查看文件 @
328e6b4
...
...
@@ -52,7 +52,7 @@ public class HamanMenu {
menuInit
.
labelMenu
(
"haman"
,
menus
);
String
apiName
=
smfApi
.
getApiName
();
if
(
Strings
.
isNotBlank
(
apiName
)){
if
(
Strings
.
isNotBlank
(
apiName
)
&&
apiName
.
equals
(
"haman"
)
){
menuInit
.
showMenu
(
apiName
);
}
}
...
...
src/main/java/com/neotel/smfcore/security/rest/MenuController.java
查看文件 @
328e6b4
...
...
@@ -20,6 +20,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.neotel.smfcore.common.annotation.QueryCondition
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.init.MenuInit
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
...
...
@@ -36,6 +37,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
...
...
@@ -66,7 +68,18 @@ public class MenuController {
private
final
IMenuManager
menuManager
;
@Autowired
private
final
MenuMapper
menuMapper
;
private
static
final
String
ENTITY_NAME
=
"menu"
;
@Autowired
MenuInit
menuInit
;
@RequestMapping
(
value
=
"/show"
)
@AnonymousAccess
public
ResponseEntity
<
Object
>
show
(
@RequestParam
String
menuPath
)
{
if
(
Strings
.
isNotBlank
(
menuPath
)){
menuInit
.
showMenu
(
menuPath
);
}
return
new
ResponseEntity
<>(
"OK"
,
HttpStatus
.
OK
);
}
@GetMapping
(
value
=
"/build"
)
@ApiOperation
(
"获取前端所需菜单"
)
...
...
src/main/resources/config/application.yml
查看文件 @
328e6b4
...
...
@@ -2,7 +2,7 @@ server:
port
:
8800
api
:
name
:
haman
name
:
Neotel
inCheckUrl
:
outNotifyUrl
:
inNotifyUrl
:
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论