bug 修改

This commit is contained in:
jiang 2024-07-29 19:22:17 +08:00
parent 5f53206f33
commit fb226e657a
6 changed files with 52 additions and 38 deletions

View File

@ -196,7 +196,7 @@ public class SysLoginService {
* @return 登录用户信息 * @return 登录用户信息
*/ */
private LoginUser handleUsernamePasswordLogin(String username, String password, long startTime) { private LoginUser handleUsernamePasswordLogin(String username, String password, long startTime) {
validateLoginParameters(username, password, startTime); // 验证登录参数 //validateLoginParameters(username, password, startTime); // 验证登录参数
validateIpBlacklist(username, startTime); // IP黑名单校验 validateIpBlacklist(username, startTime); // IP黑名单校验
R<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER); R<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
validateUserResult(username, userResult, startTime); // 验证用户查询结果 validateUserResult(username, userResult, startTime); // 验证用户查询结果

View File

@ -14,7 +14,7 @@ public class ValidateUtils {
/** /**
* 密码校验规则 * 密码校验规则
*/ */
public static int MAX_LENGTH=26; public static int MAX_LENGTH=20;
public static int MIN_LENGTH=8; public static int MIN_LENGTH=8;

View File

@ -173,6 +173,9 @@ public class AecDecryptParamFilter extends AbstractGatewayFilterFactory {
throw new CaptchaException("请求参数不正确"); throw new CaptchaException("请求参数不正确");
} }
String encrypt = Sm3Util.encrypt(query); String encrypt = Sm3Util.encrypt(query);
System.err.println(encrypt);
System.err.println(query);
System.err.println(providedHmac);
log.debug("加密后的参数: {}", encrypt); log.debug("加密后的参数: {}", encrypt);
log.debug("请求头中的 Params-Hash: {}", providedHmac); log.debug("请求头中的 Params-Hash: {}", providedHmac);
if (!encrypt.equals(providedHmac)) { if (!encrypt.equals(providedHmac)) {

View File

@ -18,11 +18,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 192.168.0.14:8848 server-addr: 192.168.0.14:8848
namespace: f648524d-0a7b-449e-8f92-64e05236fd51 namespace: f0e6fc14-465e-4268-adc8-cb33c3d4d755
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 192.168.0.14:8848 server-addr: 192.168.0.14:8848
namespace: f648524d-0a7b-449e-8f92-64e05236fd51 namespace: f0e6fc14-465e-4268-adc8-cb33c3d4d755
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
@ -50,7 +50,7 @@ spring:
#系统 自动 加解密开关 #系统 自动 加解密开关
system: system:
encryptEnabled: false encryptEnabled: true
decryptEnabled: true decryptEnabled: true
#加密组件 #加密组件
jasypt: jasypt:

View File

@ -132,8 +132,8 @@ public class SysRoleController extends BaseController
return toAjax(roleService.updateRole(role)); return toAjax(roleService.updateRole(role));
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
@ -150,8 +150,8 @@ public class SysRoleController extends BaseController
return toAjax(roleService.authDataScope(role)); return toAjax(roleService.authDataScope(role));
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
/** /**
@ -168,8 +168,8 @@ public class SysRoleController extends BaseController
return toAjax(roleService.updateRoleStatus(role)); return toAjax(roleService.updateRoleStatus(role));
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
@ -185,8 +185,9 @@ public class SysRoleController extends BaseController
return toAjax(roleService.deleteRoleByIds(roleIds)); return toAjax(roleService.deleteRoleByIds(roleIds));
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
@ -201,8 +202,8 @@ public class SysRoleController extends BaseController
return success(roleService.selectRoleAll()); return success(roleService.selectRoleAll());
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
/** /**
@ -250,8 +251,8 @@ public class SysRoleController extends BaseController
return toAjax(roleService.deleteAuthUser(userRole)); return toAjax(roleService.deleteAuthUser(userRole));
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
@ -266,8 +267,8 @@ public class SysRoleController extends BaseController
return toAjax(roleService.deleteAuthUsers(roleId, userIds)); return toAjax(roleService.deleteAuthUsers(roleId, userIds));
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
@ -283,8 +284,8 @@ public class SysRoleController extends BaseController
return toAjax(roleService.insertAuthUsers(roleId, userIds)); return toAjax(roleService.insertAuthUsers(roleId, userIds));
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
/** /**
@ -300,7 +301,7 @@ public class SysRoleController extends BaseController
return ajax; return ajax;
}catch (Exception e){ }catch (Exception e){
logger.error(e.toString(),e); logger.error(e.toString(),e);
return error(e.getMessage());
} }
return error("系统异常,请联系管理员");
} }
} }

View File

@ -3,75 +3,85 @@ package com.bonus.system.domain.vo;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.bonus.system.api.domain.SysDept; import com.bonus.system.api.domain.SysDept;
import com.bonus.system.domain.SysMenu; import com.bonus.system.domain.SysMenu;
/** /**
* Treeselect树结构实体类 * Treeselect树结构实体类
* *
* @author bonus * @author bonus
*/ */
public class TreeSelect implements Serializable public class TreeSelect implements Serializable {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 节点ID */ /**
* 节点ID
*/
private Long id; private Long id;
/** 节点名称 */ /**
* 节点名称
*/
private String label; private String label;
/** 子节点 */ private String status;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeSelect> children; private List<TreeSelect> children;
public TreeSelect() public TreeSelect() {
{
} }
public TreeSelect(SysDept dept) public TreeSelect(SysDept dept) {
{
this.id = dept.getDeptId(); this.id = dept.getDeptId();
this.status = dept.getStatus();
this.label = dept.getDeptName(); this.label = dept.getDeptName();
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
} }
public TreeSelect(SysMenu menu) public TreeSelect(SysMenu menu) {
{
this.id = menu.getMenuId(); this.id = menu.getMenuId();
this.label = menu.getMenuName(); this.label = menu.getMenuName();
this.status = menu.getStatus();
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
} }
public Long getId() public Long getId() {
{
return id; return id;
} }
public void setId(Long id) public void setId(Long id) {
{
this.id = id; this.id = id;
} }
public String getLabel() public String getLabel() {
{
return label; return label;
} }
public void setLabel(String label) public void setLabel(String label) {
{
this.label = label; this.label = label;
} }
public List<TreeSelect> getChildren() public List<TreeSelect> getChildren() {
{
return children; return children;
} }
public void setChildren(List<TreeSelect> children) public void setChildren(List<TreeSelect> children) {
{
this.children = children; this.children = children;
} }
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
} }