Commit c283210c authored by zhangzc's avatar zhangzc

修改bug

parent 6e0c1a2c
......@@ -224,4 +224,16 @@ public class TokenComponent {
public String getTokenInfoCacheKey(String account, Integer accountType) {
return applicationName + "::token::" + accountType + "::" + account;
}
/**
* description 清除缓存Key
* param [account, accountType]
* return java.lang.String
* author Administrator
* createTime 2020/05/14 15:07
**/
public void cleatTokenInfoCache(TokenInfoPojo tokenInfoPojo) {
String key =getTokenInfoCacheKey(tokenInfoPojo.getAccount(), tokenInfoPojo.getAccountType());
redisComponent.del(key);
}
}
......@@ -41,4 +41,10 @@ public class AccountConstants {
public static final Integer ACCOUNT_LOGIN_MODE_PWD = 1;
public static final Integer ACCOUNT_LOGIN_MODE_SMS = 2;
/**
* 审核状态:0-待审核、1-审核成功,2-审核失败
**/
public static final Integer AUDIT_STATUS_CHECK_PENDING = 0;
public static final Integer AUDIT_STATUS_CHECK_SUCCESS = 1;
public static final Integer AUDIT_STATUS_CHECK_FAIL = 2;
}
......@@ -28,6 +28,7 @@ import com.esv.freight.app.module.account.vo.CarrierInfoBriefVO;
import com.esv.freight.app.module.account.vo.DriverAccountDetailVO;
import com.esv.freight.app.module.account.vo.LoginVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
......@@ -133,10 +134,12 @@ public class DriverAccountController {
return FeignUtils.getFeignEResponse(result);
}
// 校验帐号状态:1-正常、2-停用
DriverAccountInfoPojo driverAccountInfoPojo = JSONObject.toJavaObject(FeignUtils.getFeignDataJson(result), DriverAccountInfoPojo.class);
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(driverAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
if (AccountConstants.AUDIT_STATUS_CHECK_SUCCESS.equals(driverAccountInfoPojo.getAuditStatus())) {
// 校验帐号状态:1-正常、2-停用
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(driverAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
}
}
// 登录
......@@ -172,10 +175,12 @@ public class DriverAccountController {
return FeignUtils.getFeignEResponse(result);
}
// 2:校验帐号状态:1-正常、2-停用
DriverAccountInfoPojo driverAccountInfoPojo = JSONObject.toJavaObject(FeignUtils.getFeignDataJson(result), DriverAccountInfoPojo.class);
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(driverAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
if (AccountConstants.AUDIT_STATUS_CHECK_SUCCESS.equals(driverAccountInfoPojo.getAuditStatus())) {
// 校验帐号状态:1-正常、2-停用
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(driverAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
}
}
// 登录
......@@ -269,7 +274,9 @@ public class DriverAccountController {
return EResponse.error(result.getInteger("code"), result.getString("message"));
}
DriverAccountDetailVO detailVO = new DriverAccountDetailVO();
DriverAccountDetailVO detailVO = JSONObject.toJavaObject(FeignUtils.getFeignDataJson(result), DriverAccountDetailVO.class);
/*
detailVO.setId(String.valueOf(result.getJSONObject("data").getLong("id")));
detailVO.setCarrierId(result.getJSONObject("data").getLong("carrierId"));
detailVO.setCarrierName(result.getJSONObject("data").getString("carrierName"));
......@@ -301,7 +308,7 @@ public class DriverAccountController {
detailVO.setCertificateVehicle(result.getJSONObject("data").getInteger("certificateVehicle"));
detailVO.setCertificateEndDate(result.getJSONObject("data").getString("certificateEndDate"));
detailVO.setCertificateNumber(result.getJSONObject("data").getString("certificateNumber"));
detailVO.setCertificateUrl(result.getJSONObject("data").getString("certificateUrl"));
detailVO.setCertificateUrl(result.getJSONObject("data").getString("certificateUrl"));*/
return EResponse.ok(detailVO);
}
......
......@@ -121,8 +121,11 @@ public class OwnerAccountController {
// 校验帐号状态:1-正常、2-停用
OwnerAccountInfoPojo ownerAccountInfoPojo = JSONObject.toJavaObject(FeignUtils.getFeignDataJson(result), OwnerAccountInfoPojo.class);
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(ownerAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
if (AccountConstants.AUDIT_STATUS_CHECK_SUCCESS.equals(ownerAccountInfoPojo.getAuditStatus())) {
// 校验帐号状态:1-正常、2-停用
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(ownerAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
}
}
// 登录
......@@ -158,10 +161,13 @@ public class OwnerAccountController {
return FeignUtils.getFeignEResponse(result);
}
// 2:校验帐号状态:1-正常、2-停用
OwnerAccountInfoPojo ownerAccountInfoPojo= JSONObject.toJavaObject(FeignUtils.getFeignDataJson(result), OwnerAccountInfoPojo.class);
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(ownerAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
// 校验帐号状态:1-正常、2-停用
OwnerAccountInfoPojo ownerAccountInfoPojo = JSONObject.toJavaObject(FeignUtils.getFeignDataJson(result), OwnerAccountInfoPojo.class);
if (AccountConstants.AUDIT_STATUS_CHECK_SUCCESS.equals(ownerAccountInfoPojo.getAuditStatus())) {
// 校验帐号状态:1-正常、2-停用
if (AccountConstants.ACCOUNT_STATUS_BLOCK.equals(ownerAccountInfoPojo.getAccountStatus())) {
return EResponse.error(1003, "帐号已停用");
}
}
// 登录
......
......@@ -137,8 +137,7 @@ public class AppLoginServiceImpl extends ServiceImpl<AppLoginDao, AppLoginEntity
this.baseMapper.updateById(appLoginEntity);
//清缓存
String key =tokenComponent.getTokenInfoCacheKey(tokenInfoPojo.getAccount(), tokenInfoPojo.getAccountType());
redisComponent.del(key);
tokenComponent.cleatTokenInfoCache(tokenInfoPojo);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment