yun-zuoyi
汪云昊 4 years ago
commit 075fb698b6

@ -204,14 +204,6 @@ public class WhiteController extends CoreBaseController {
@GetMapping(value = "/auth/{loginStrategy}/sso-login")
@ApiOperation(value = "登录", notes = "登录")
public ResultBean ssoLogin(HttpServletRequest request, @PathVariable(name = "loginStrategy") String loginStrategy) throws NoSuchFieldException {
try {
SessionUser sessionUser = AuthUtil.getSessionUser();
if (sessionUser != null) {
return new ResultBean(true, AuthUtil.getSession().getId().toString(), AuthUtil.getSessionUser());
}
} catch (Exception e) {
LOGGER.info("SSO 单点登录 未找到session 跳过");
}
String fieldMapping = RedisCacheTool.getSysConfigStrVal(PlatformConstWords.SSO_REQUEST_MAPPING);
if (StringUtils.isEmpty(fieldMapping)) {
return ResultBean.fail("请在平台数据库中配置表添加字段映射配置");
@ -223,6 +215,17 @@ public class WhiteController extends CoreBaseController {
ValidatorBean.beginValid(loginModel)
.notNull("loginStrategy", loginModel.getLoginStrategy())
.notNull("loginName", loginModel.getLoginName());
try {
SessionUser sessionUser = AuthUtil.getSessionUser();
if (sessionUser != null) {
if (sessionUser.getUserCode().equals(loginModel.getLoginName()) || sessionUser.getUserName().equals(loginModel.getLoginName())) {
return new ResultBean(true, AuthUtil.getSession().getId().toString(), AuthUtil.getSessionUser());
}
}
} catch (Exception e) {
LOGGER.info("SSO 单点登录 未找到session 跳过");
}
String beanName = ImppEnumUtil.AUTH_LOGIN_STRATEGY.codeOfStrategyName(loginModel.getLoginStrategy());
ISystemLoginStrategyService loginStrategyService = (ISystemLoginStrategyService) SpringContextsUtil.getBean(beanName);

@ -63,13 +63,12 @@ public class SysLogFactory implements ISysLogService {
if (ImppSwitchUtil.isElasticSearchSwitch() && elasticSearchService != null) {
return elasticSearchService;
} else {
return elasticSearchService;
// throw ImppExceptionBuilder.newInstance()
// .setSystemID(CommonEnumUtil.SOFT_TYPE.IMPP.getCode())
// .setErrorCode(ImppExceptionEnum.LOG_SAVE_STORAGE_ERROR.getCode())
// .setErrorDetail("没有开启Elasticsearch储存技术,请联系管理员")
// .setErrorSolution("请检查配置文件")
// .build();
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.IMPP.getCode())
.setErrorCode(ImppExceptionEnum.LOG_SAVE_STORAGE_ERROR.getCode())
.setErrorDetail("没有开启Elasticsearch储存技术,请联系管理员")
.setErrorSolution("请检查配置文件")
.build();
}
}

Loading…
Cancel
Save