|
@@ -30,22 +30,20 @@ public class LoginService {
|
|
|
IAgentNewService iAgentNewService;
|
|
|
|
|
|
public ResultData login(FdkkLoginRequest param) {
|
|
|
- try {
|
|
|
- this.checkLoginNum(param.getIp(),param.getPhoneNum());
|
|
|
- AgentNewVo agentNewVo = iAgentNewService.getByUserName(param.getPhoneNum());
|
|
|
- if(agentNewVo == null || agentNewVo.getStatus() == 1){
|
|
|
- this.addLoginErrorNum(param.getIp(),param.getPhoneNum());
|
|
|
- throw new BusinessException(ResultCode.AGENT_USER_EMPTY);
|
|
|
- }
|
|
|
- FdkkResponse<FdkkLoginVo> fdkkLoginVo = fdKKClient.fdkkLogin(param);
|
|
|
- if(fdkkLoginVo.getCode() == 0){
|
|
|
- fdkkLoginVo.getData().setAgent(agentNewVo);
|
|
|
- return ResultData.ok(fdkkLoginVo.getData());
|
|
|
- }
|
|
|
+ this.checkLoginNum(param.getIp(),param.getPhoneNum());
|
|
|
+ AgentNewVo agentNewVo = iAgentNewService.getByUserName(param.getPhoneNum());
|
|
|
+ if(agentNewVo == null ){
|
|
|
this.addLoginErrorNum(param.getIp(),param.getPhoneNum());
|
|
|
- throw new BusinessException(ResultCode.FD_ERROR);
|
|
|
- }catch (Exception e){
|
|
|
- log.error("fd登录失败",e);
|
|
|
+ throw new BusinessException(ResultCode.AGENT_USER_EMPTY);
|
|
|
+ }
|
|
|
+ if(agentNewVo.getStatus() == 1 ){
|
|
|
+ this.addLoginErrorNum(param.getIp(),param.getPhoneNum());
|
|
|
+ throw new BusinessException(ResultCode.AGENT_STOP_USE);
|
|
|
+ }
|
|
|
+ FdkkResponse<FdkkLoginVo> fdkkLoginVo = fdKKClient.fdkkLogin(param);
|
|
|
+ if(fdkkLoginVo.getCode() == 0){
|
|
|
+ fdkkLoginVo.getData().setAgent(agentNewVo);
|
|
|
+ return ResultData.ok(fdkkLoginVo.getData());
|
|
|
}
|
|
|
this.addLoginErrorNum(param.getIp(),param.getPhoneNum());
|
|
|
throw new BusinessException(ResultCode.FD_ERROR);
|