|
|
@@ -362,16 +362,16 @@ public class AuthServiceImpl implements IAuthService {
|
|
|
@Override
|
|
|
public HttpResult driverAuth(LoginBase loginBase) {
|
|
|
/**查询用户信息**/
|
|
|
- RDriverDetailVo driver = fleetService.findDriver(loginBase.getAccount());
|
|
|
+ RDriverDetailVo driver = fleetService.findDriverDetai(loginBase.getAccount());
|
|
|
/**信息校验**/
|
|
|
if (driver == null) {
|
|
|
- return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
|
|
|
+ return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
|
|
|
}
|
|
|
if (!PasswordUtils.validatePassword(loginBase.getPassword(), driver.getPassword())) {
|
|
|
- return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
|
|
|
+ return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
|
|
|
}
|
|
|
if (driver.getStatus() == Global.YES) {
|
|
|
- return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服:400-803-6377!");
|
|
|
+ return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服:400-803-6377!");
|
|
|
}
|
|
|
//企业信息
|
|
|
REnterpriseVo enterprise = systemService.queryEntDetails(driver.getEntId());
|
|
|
@@ -379,7 +379,7 @@ public class AuthServiceImpl implements IAuthService {
|
|
|
/**生成token**/
|
|
|
String token = EncryUtil.encryV1(Global.PRI_KEY, String.valueOf(driver.getId()));
|
|
|
if (StringUtils.isBlank(token)) {
|
|
|
- return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
|
|
|
+ return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
|
|
|
}
|
|
|
|
|
|
/**缓存司机/企业信息**/
|
|
|
@@ -387,10 +387,11 @@ public class AuthServiceImpl implements IAuthService {
|
|
|
|
|
|
/**数据组装**/
|
|
|
LoginResVo1 loginRes = new LoginResVo1();
|
|
|
+ BeanUtils.copyPropertiesValue(driver, loginRes);
|
|
|
loginRes.setAccount(loginBase.getAccount());
|
|
|
- loginRes.setFirmName(enterprise.getFirmName());
|
|
|
- loginRes.setApproval(enterprise.getApproval());
|
|
|
- loginRes.setEntTypeNames(enterprise.getEntTypeNames());
|
|
|
+ loginRes.setFirmName(enterprise != null ? enterprise.getFirmName() : null);
|
|
|
+ loginRes.setApproval(enterprise != null ? enterprise.getApproval() : null);
|
|
|
+ loginRes.setEntTypeNames(enterprise != null ? enterprise.getEntTypeNames() : null);
|
|
|
loginRes.setClientType(loginBase.getClientType());
|
|
|
loginRes.setSystemType(loginBase.getSystemType());
|
|
|
loginRes.setToken(token);
|