mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 20:06:51 +08:00
登录测试
This commit is contained in:
@@ -57,6 +57,11 @@ public class PortalConsoleApi extends ApiBaseController{
|
||||
Map<String,Object> map=new HashMap<String,Object>();
|
||||
try {
|
||||
Account account = accountService.get(getCurrent().getAccountId());
|
||||
if(account==null) {
|
||||
log.error("未找到账号id【"+getCurrent().getAccountId()+"】对应的用户");
|
||||
return error("账号错误,无此账号");
|
||||
}
|
||||
|
||||
User user = userService.get(getCurrent().getAccountId());
|
||||
Organization org = null;
|
||||
String departName = "";
|
||||
|
||||
@@ -209,23 +209,26 @@ public class PortalLoginApi extends ApiBaseController {
|
||||
//检查系统用户是否存在
|
||||
account = accountService.get(tokenInfo.get("aid"));
|
||||
}else{
|
||||
log.error("查询用户kid【"+tokenInfo.get("userId")+"】");
|
||||
// 没有aid则判断是否已同步的用户,不是则同步
|
||||
if(StringUtil.isNotBlank(tokenInfo.get("userId"))){
|
||||
account = accountService.findLoginBySysId(tokenInfo.get("userId"));
|
||||
if(account == null){ //系统中无此用户,需要同步用户
|
||||
log.error("未找到【"+tokenInfo.get("userId")+"】的用户");
|
||||
UserVo fwUser = fwUserService.getById(tokenInfo.get("userId"));
|
||||
if(fwUser != null) {
|
||||
try {
|
||||
account = userService.syncUser(fwUser);
|
||||
} catch (Exception e) {
|
||||
log.error("boelogin同步用户错误:" + e.getMessage());
|
||||
return error("登录失败,未同步用户");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if(account.getDeleted()) {
|
||||
return error("登录失败,用户已被删除,请与管理员联系");
|
||||
}else if(account.getStatus()==Account.STATUS_DEAD) {
|
||||
return error("登录失败,用户已被停用,请与管理员联系");
|
||||
if(account.getDeleted()!=null && account.getDeleted()) {
|
||||
return error("登录失败,用户已删除,请与管理员联系");
|
||||
}else if(account.getStatus()!=null && account.getStatus()==Account.STATUS_DEAD) {
|
||||
return error("登录失败,用户已停用,请与管理员联系");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user