Commit e55eb479 by 吕明尚

修改报token失效

parent 4238c280
...@@ -158,7 +158,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -158,7 +158,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject data = entries.getJSONObject("data"); JSONObject data = entries.getJSONObject("data");
if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) {
clientToken(); clientToken();
prepare(tiktokCouponDto); return prepare(tiktokCouponDto);
} }
if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) { if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) {
logger.error("抖音验券准备失败:{}", data.getStr("description")); logger.error("抖音验券准备失败:{}", data.getStr("description"));
...@@ -184,7 +184,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -184,7 +184,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject data = entries.getJSONObject("data"); JSONObject data = entries.getJSONObject("data");
if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) {
clientToken(); clientToken();
verify(tiktokCouponDto); return verify(tiktokCouponDto);
} }
JSONObject extra = entries.getJSONObject("extra"); JSONObject extra = entries.getJSONObject("extra");
if (data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode()) && ((JSONObject) data.getJSONArray("verify_results").get(0)).getStr("result").equals(ErrorCodeEnum.SUCCESS.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode()) && ((JSONObject) data.getJSONArray("verify_results").get(0)).getStr("result").equals(ErrorCodeEnum.SUCCESS.getCode())) {
...@@ -213,7 +213,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -213,7 +213,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject data = entries.getJSONObject("data"); JSONObject data = entries.getJSONObject("data");
if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) {
clientToken(); clientToken();
cancel(tiktokCouponDto); return cancel(tiktokCouponDto);
} }
if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) { if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) {
logger.error("抖音撤销核销失败:{}", data.getStr("description")); logger.error("抖音撤销核销失败:{}", data.getStr("description"));
...@@ -240,7 +240,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -240,7 +240,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject data = entries.getJSONObject("data"); JSONObject data = entries.getJSONObject("data");
if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) {
clientToken(); clientToken();
certificateGet(encryptedCode); return certificateGet(encryptedCode);
} }
if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) { if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) {
logger.error("抖音获取核销信息失败:{}", data.getStr("description")); logger.error("抖音获取核销信息失败:{}", data.getStr("description"));
...@@ -264,7 +264,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -264,7 +264,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject data = entries.getJSONObject("data"); JSONObject data = entries.getJSONObject("data");
if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) {
clientToken(); clientToken();
poiQuery(tiktokCouponDto); return poiQuery(tiktokCouponDto);
} }
if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) { if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) {
throw new RuntimeException(data.getStr("description")); throw new RuntimeException(data.getStr("description"));
...@@ -301,7 +301,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -301,7 +301,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject data = entries.getJSONObject("data"); JSONObject data = entries.getJSONObject("data");
if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) {
clientToken(); clientToken();
onlineQuery(onlineQueryDto); return onlineQuery(onlineQueryDto);
} }
if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) { if (!data.getStr("error_code").equals(ErrorCodeEnum.SUCCESS.getCode())) {
throw new RuntimeException(data.getStr("description")); throw new RuntimeException(data.getStr("description"));
...@@ -322,7 +322,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -322,7 +322,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject data = entries.getJSONObject("data"); JSONObject data = entries.getJSONObject("data");
if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) { if (data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_INVALID.getCode()) | data.getStr("error_code").equals(ErrorCodeEnum.ACCESS_TOKEN_EXPIRE.getCode())) {
clientToken(); clientToken();
onlineGet(productIds, accountId); return onlineGet(productIds, accountId);
} }
return data; return data;
} }
......
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