|
|
|
@ -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失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|