mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
udpate 联联获取令牌接口
This commit is contained in:
@@ -88,6 +88,9 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
@Autowired
|
||||
private IThirdPartySettingInfoService thirdPartySettingInfoService;
|
||||
|
||||
@Autowired
|
||||
private IDockingPlatformConfigService dockingPlatformConfigService;
|
||||
|
||||
@Override
|
||||
public void pushMerchantInfo(Long merchantId) {
|
||||
// 通过id查询运营商信息
|
||||
@@ -1231,7 +1234,11 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
public Map<String, String> generateToken(QueryTokenDTO dto) throws UnsupportedEncodingException {
|
||||
String operatorID = dto.getOperatorID();
|
||||
// 通过operatorID 查出 operatorSecret TODO 建表 设置密钥
|
||||
String operatorSecret = "123123123123aaaa";
|
||||
DockingPlatformConfig platformConfig = dockingPlatformConfigService.getInfoByOperatorId(operatorID);
|
||||
if (platformConfig == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorSecret = platformConfig.getOperatorSecret();
|
||||
|
||||
Map<String, String> map = Maps.newLinkedHashMap();
|
||||
map.put("OperatorID", dto.getOperatorID());
|
||||
@@ -1270,11 +1277,11 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据 TODO vo对象加密
|
||||
// byte[] encryptText = Cryptos.aesEncrypt(JSONObject.toJSONString(vo).getBytes(),
|
||||
// dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
// String encryptData = Encodes.encodeBase64(encryptText);
|
||||
byte[] encryptText = Cryptos.aesEncrypt(JSONObject.toJSONString(vo).getBytes(),
|
||||
platformConfig.getDataSecret().getBytes(), platformConfig.getDataSecretIv().getBytes());
|
||||
String encryptData = Encodes.encodeBase64(encryptText);
|
||||
|
||||
// resultMap.put("Data", encryptData);
|
||||
resultMap.put("Data", encryptData);
|
||||
// 生成sig TODO 生成sig
|
||||
String resultSign = GBSignUtils.sign(resultMap, operatorSecret);
|
||||
resultMap.put("Sig", resultSign);
|
||||
|
||||
Reference in New Issue
Block a user