From 2c766d79a34c745f1f8bad07ddaefbbef1831bd7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 23 May 2020 10:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF=E7=BC=96?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/LoginServiceImpl.java | 7 ++++--- .../com/epmet/commons/tools/exception/EpmetErrorCode.java | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 728ca2d1ef..a796eedf89 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -264,13 +264,14 @@ public class LoginServiceImpl implements LoginService { passwordLoginUserInfoFormDTO.setPhone(formDTO.getPhone()); Result userInfoResult = epmetUserFeignClient.selectLoginUserInfoByPassword(passwordLoginUserInfoFormDTO); if (!userInfoResult.success() || null == userInfoResult.getData()) { - logger.error("根据手机号查询运营人员信息失败"); - throw new RenException("账号不存在"); + logger.error("根据手机号查询运营人员信息失败,返回10003账号不存在"); + throw new RenException(EpmetErrorCode.ERR10003.getCode()); } //3、密码是否正确 //密码错误 if (!PasswordUtils.matches(formDTO.getPassword(), userInfoResult.getData().getPassWord())) { - throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); + logger.error(String.format("手机号密码登陆失败,返回10004密码错误,用户输入密码%s,数据库密码%s",formDTO.getPassword(), userInfoResult.getData().getPassWord())); + throw new RenException(EpmetErrorCode.ERR10004.getCode()); } //4、生成token返回,且将TokenDto存到redis UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index be6c609d81..e65a0c43d2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -6,6 +6,14 @@ package com.epmet.commons.tools.exception; * @Description: */ public enum EpmetErrorCode { + /** + * 账号或密码错误ACCOUNT_NOT_EXIST + */ + ERR10003( 10003,"账号不存在"), + /** + * 账号或密码错误ACCOUNT_PASSWORD_ERROR + */ + ERR10004( 10004,"密码错误"), ERR10005(10005, "token不能为空"), ERR10006(10006, "登录超时,请重新登录"), ERR10007(10007, "当前帐号已在别处登录"),