因当前环节测试,添加默认账号为 admin

This commit is contained in:
fanghongchao
2018-11-28 11:35:02 +08:00
parent 5e5cd016a7
commit d2384e7df0
@@ -40,29 +40,29 @@ public class UserServiceImpl implements IUserService {
//获取网关header中传递的用户信息
private HeaderUserDto getHeaderUserDto() {
// HeaderUserDto dto = new HeaderUserDto();
// dto.setUserId("00000000000000000000000000000000");
// dto.setUserName("admin");
// dto.setRealName("超级管理员");
// return dto;
try
{
String userStr = request.getHeader("user");
logger.info("gateway-User:"+userStr);
if(null == userStr)
{
throw new UserNoLoginException();
}
BASE64Decoder base64Decoder = new BASE64Decoder();
byte[] bt = base64Decoder.decodeBuffer(userStr);
ObjectMapper objectMapper = new ObjectMapper();
return objectMapper.readValue(bt, HeaderUserDto.class);
}
catch (IOException e)
{
throw new RuntimeException("header userinfo error!"+e.getMessage());
}
HeaderUserDto dto = new HeaderUserDto();
dto.setUserId("00000000000000000000000000000000");
dto.setUserName("admin");
dto.setRealName("超级管理员");
return dto;
// try
// {
// String userStr = request.getHeader("user");
// logger.info("gateway-User:"+userStr);
// if(null == userStr)
// {
// throw new UserNoLoginException();
// }
// BASE64Decoder base64Decoder = new BASE64Decoder();
// byte[] bt = base64Decoder.decodeBuffer(userStr);
//
// ObjectMapper objectMapper = new ObjectMapper();
// return objectMapper.readValue(bt, HeaderUserDto.class);
// }
// catch (IOException e)
// {
// throw new RuntimeException("header userinfo error!"+e.getMessage());
// }
}