Przeglądaj źródła

深时下载添加语言

lyhzzz 1 rok temu
rodzic
commit
e026211e2e

+ 1 - 0
src/main/java/com/fdkankan/agent/common/ResultCode.java

@@ -30,6 +30,7 @@ public enum ResultCode {
     FILE_TYPE_ERROR(4027, "文件格式校验,需为xlsx文件"),
     TEMPLATE_TYPE_ERROR(4028, "模板格式错误"),
     UPLOAD_EXCEL_ERROR(4029, "批量导入失败"),
+    AGENT_STOP_USE(4030, "当前账号已停用,请联系管理员"),
 
     ;
 

+ 13 - 15
src/main/java/com/fdkankan/agent/service/LoginService.java

@@ -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);