|
@ -5,8 +5,10 @@ import com.epmet.common.token.constant.LoginConstant; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.ServiceConstant; |
|
|
import com.epmet.commons.tools.constant.ServiceConstant; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
|
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
|
|
import com.epmet.commons.tools.security.dto.GovTokenDto; |
|
|
import com.epmet.commons.tools.security.dto.GovTokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.password.PasswordUtils; |
|
|
import com.epmet.commons.tools.security.password.PasswordUtils; |
|
@ -46,7 +48,7 @@ import java.util.stream.Collectors; |
|
|
* @Date 2020/4/20 10:56 |
|
|
* @Date 2020/4/20 10:56 |
|
|
*/ |
|
|
*/ |
|
|
@Service |
|
|
@Service |
|
|
public class GovLoginServiceImpl implements GovLoginService { |
|
|
public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver { |
|
|
private static final Logger logger = LoggerFactory.getLogger(GovLoginServiceImpl.class); |
|
|
private static final Logger logger = LoggerFactory.getLogger(GovLoginServiceImpl.class); |
|
|
private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; |
|
|
private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; |
|
|
@Autowired |
|
|
@Autowired |
|
@ -490,5 +492,30 @@ public class GovLoginServiceImpl implements GovLoginService { |
|
|
} |
|
|
} |
|
|
return result.getData(); |
|
|
return result.getData(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public String blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password) { |
|
|
|
|
|
|
|
|
|
|
|
GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); |
|
|
|
|
|
form.setCustomerId(customerId); |
|
|
|
|
|
form.setMobile(mobile); |
|
|
|
|
|
|
|
|
|
|
|
GovWebOperLoginResultDTO staff = getResultDataOrThrowsException(epmetUserFeignClient.getStaffIdAndPwd(form), ServiceConstant.EPMET_USER_SERVER, |
|
|
|
|
|
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), |
|
|
|
|
|
String.format("【区块链获取用户信息】根据手机号%s和指定客户ID:%s查找用户信息失败", mobile, customerId), |
|
|
|
|
|
"查询用户失败"); |
|
|
|
|
|
|
|
|
|
|
|
if (staff == null) { |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), |
|
|
|
|
|
String.format("【区块链获取用户信息】根据手机号%s和指定客户ID:%s查找用户信息失败", mobile, customerId)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!PasswordUtils.matches(password, staff.getPassWord())) { |
|
|
|
|
|
// 密码不匹配
|
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.ERR10004.getCode(), String.format("【区块链获取用户信息】密码不匹配,手机号:%s", mobile)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return staff.getUserId(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|