|
|
@ -12,6 +12,7 @@ import com.elink.esua.epdc.async.UserDeptTask; |
|
|
|
import com.elink.esua.epdc.common.token.dto.DeptDataScopeDTO; |
|
|
|
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|
|
|
import com.elink.esua.epdc.common.token.dto.WorkUserAuthorizationDTO; |
|
|
|
import com.elink.esua.epdc.common.token.dto.WorkUserAuthorizationScripDTO; |
|
|
|
import com.elink.esua.epdc.common.token.util.CpUserDetailRedis; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
@ -299,7 +300,7 @@ public class AuthServiceImpl implements AuthService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<WorkUserAuthorizationDTO> workScripLogin(String scrip) { |
|
|
|
public Result<WorkUserAuthorizationScripDTO> workScripLogin(String scrip) { |
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
|
|
|
|
|
|
|
//获取用户信息
|
|
|
@ -324,7 +325,7 @@ public class AuthServiceImpl implements AuthService { |
|
|
|
log.setCreatorName(scrip); |
|
|
|
logProducer.saveLog(log); |
|
|
|
authorization.setRegisterState(NumConstant.ZERO_STR); |
|
|
|
return new Result<WorkUserAuthorizationDTO>().error("未根据凭证获取到用户"); |
|
|
|
return new Result<WorkUserAuthorizationScripDTO>().error("未根据凭证获取到用户"); |
|
|
|
} |
|
|
|
|
|
|
|
//账号停用
|
|
|
@ -333,7 +334,7 @@ public class AuthServiceImpl implements AuthService { |
|
|
|
log.setCreator(user.getId()); |
|
|
|
log.setCreatorName(user.getUsername()); |
|
|
|
logProducer.saveLog(log); |
|
|
|
return new Result<WorkUserAuthorizationDTO>().error("账号已停用"); |
|
|
|
return new Result<WorkUserAuthorizationScripDTO>().error("账号已停用"); |
|
|
|
} |
|
|
|
|
|
|
|
//保存到Redis
|
|
|
@ -360,6 +361,9 @@ public class AuthServiceImpl implements AuthService { |
|
|
|
authorization.setRegisterState(NumConstant.ONE_STR); |
|
|
|
|
|
|
|
userDeptTask.packageUserDeptOptions(user.getId()); |
|
|
|
|
|
|
|
return new Result<WorkUserAuthorizationDTO>().ok(authorization); } |
|
|
|
WorkUserAuthorizationScripDTO workUserAuthorizationScripDTO = new WorkUserAuthorizationScripDTO(); |
|
|
|
workUserAuthorizationScripDTO.setWorkUserAuthorizationDTO(authorization); |
|
|
|
workUserAuthorizationScripDTO.setUsername(user.getUsername()); |
|
|
|
return new Result<WorkUserAuthorizationScripDTO>().ok(workUserAuthorizationScripDTO); |
|
|
|
} |
|
|
|
} |
|
|
|