Commit 328e6b4b sunke

菜单重构

1 个父辈 4554c37b
......@@ -188,8 +188,12 @@ 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);
for (String clientLabel : clientLabels) {
addMenu(clientLabel, menu);
if(clientLabels.length == 0){
addMenu("",menu);
}else{
for (String clientLabel : clientLabels) {
addMenu(clientLabel, menu);
}
}
}
......
......@@ -81,7 +81,7 @@ public class PermissionInitUtil {
if (array.length >= 1 && permissionSet.contains(array[0])) {
} else {
log.info("未找到权限【" + hasP + "】");
//log.info("未找到权限【" + hasP + "】");
}
}
}
......
......@@ -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);
}
}
......
......@@ -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("获取前端所需菜单")
......
......@@ -2,7 +2,7 @@ server:
port: 8800
api:
name: haman
name: Neotel
inCheckUrl:
outNotifyUrl:
inNotifyUrl:
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!