Browse Source

1.修改获取token的报错日志

dev-warehouse
zhenghaoyu 2 years ago
parent
commit
d1c0624efc
  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);
logger.info("##############getMengtianToken: 获取梦天token返回参数 {}",result);
Integer code = jsonObject.getInteger("Result");
String access_token = jsonObject.getString("Data");
if(StringUtil.hasLength(access_token)){
mtToken= access_token;
// 加入redis
bladeRedis.setEx("mt_token",mtToken,25*60L);
if(0 == code){
if(StringUtil.hasLength(access_token)){
mtToken= access_token;
// 加入redis
bladeRedis.setEx("mt_token",mtToken,25*60L);
}else{
log.warn("###############getMengtianToken: 获取梦天token失败 access_token={}",access_token);
throw new CustomerException(402,"获取梦天token失败");
}
}else{
log.warn("###############getMengtianToken: 获取梦天token失败 code={}",code);
throw new CustomerException(402,"获取梦天token失败");
}
}

Loading…
Cancel
Save