add oa单点登录

This commit is contained in:
lijiarao
2024-02-26 17:44:53 +08:00
parent efe8cd99b9
commit f91350951e
5 changed files with 125 additions and 0 deletions
@@ -120,4 +120,6 @@ public interface ILoginService{
* @return
*/
public Result<JSONObject> srmsByToken(String username);
Result<JSONObject> loginByUserName(String userName);
}
@@ -729,4 +729,25 @@ public class LoginServiceImpl implements ILoginService {
baseCommonService.addLog(USER_NAME + userName + LOGIN_SUCCEED, CommonConstant.LOG_TYPE_1, null,loginUser);
return result;
}
@Override
public Result<JSONObject> loginByUserName(String userName) {
// 获取用户信息
SysUser sysUser = sysUserService.getUserByName(userName);
// 校验用户是否有效
Result<JSONObject> result = sysUserService.checkUserIsEffective(sysUser);
if(!result.isSuccess()) {
return result;
}
if (checkSysPermission(sysUser.getUsername())) {
return Result.error("该用户无权限,请联系管理员");
}
//用户登录信息
userInfo(sysUser, result);
//update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员
LoginUser loginUser = new LoginUser();
BeanUtils.copyProperties(sysUser, loginUser);
baseCommonService.addLog(USER_NAME + userName + LOGIN_SUCCEED, CommonConstant.LOG_TYPE_1, null,loginUser);
return result;
}
}