IP白名单配置新增直接生效(需要分配权限,此功能才可开启).

ip白名单配置生效状态下可修改(修改delRow的判断才可开启此功能).
This commit is contained in:
段冬梅
2019-04-13 09:01:24 +08:00
parent bca7de6990
commit a478bee5f3
8 changed files with 94 additions and 25 deletions

View File

@@ -194,7 +194,7 @@ public class IpController extends BaseController{
/*if(StringUtils.isNoneBlank(entity.getUserRegion4())) {
ipCfgService.auditAsnCfg(entity, isAudit);
}else {*/
ipCfgService.auditIpCfg(entity,isAudit);
ipCfgService.auditIpCfg(entity,isAudit,Constants.INSERT_ACTION);
/*}*/
addMessage(redirectAttributes,"success", "audit_success");
} catch (Exception e) {

View File

@@ -97,9 +97,24 @@ public class WhiteListController extends CommonController {
}
@RequestMapping(value = { "ip/save" })
public String saveIpCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
public String saveIpCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes,
String ids, CfgIndexInfo entity) {
ipCfgService.saveIpCfg(entity);
try {
ipCfgService.saveIpCfg(entity);
//配置仅保存
if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
addMessage(redirectAttributes, "success", "save_success");
}else {
//配置直接生效
addMessage(redirectAttributes, "success", "audit_success");
}
} catch (MaatConvertException e) {
logger.error("ip白名单配置下发失败",e);
addMessage(redirectAttributes, "error", "request_service_failed");
} catch (Exception e) {
logger.error("ip白名单配置保存失败",e);
addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + entity.getFunctionId();
}
@@ -115,11 +130,9 @@ public class WhiteListController extends CommonController {
entity = ipCfgService.getIpPortCfg(Long.parseLong(id), null);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
ipCfgService.auditIpCfg(entity, isAudit);
ipCfgService.auditIpCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (MaatConvertException e) {
logger.info("ip配置下发失败" + e.getMessage());