Browse Source

Merge branch 'test' into pre-production

dev-warehouse
zhenghaoyu 2 years ago
parent
commit
ea3a4d0071
  1. 15
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

15
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

@ -217,12 +217,19 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
logger.info("##############getMengtianToken: 获取梦天token返回参数 {}",result); logger.info("##############getMengtianToken: 获取梦天token返回参数 {}",result);
Integer code = jsonObject.getInteger("Result");
String access_token = jsonObject.getString("Data"); String access_token = jsonObject.getString("Data");
if(StringUtil.hasLength(access_token)){ if(0 == code){
mtToken= access_token; if(StringUtil.hasLength(access_token)){
// 加入redis mtToken= access_token;
bladeRedis.setEx("mt_token",mtToken,25*60L); // 加入redis
bladeRedis.setEx("mt_token",mtToken,25*60L);
}else{
log.warn("###############getMengtianToken: 获取梦天token失败 access_token={}",access_token);
throw new CustomerException(402,"获取梦天token失败");
}
}else{ }else{
log.warn("###############getMengtianToken: 获取梦天token失败 code={}",code);
throw new CustomerException(402,"获取梦天token失败"); throw new CustomerException(402,"获取梦天token失败");
} }
} }

Loading…
Cancel
Save