|
@@ -122,16 +122,16 @@ public class CallbackController {
|
|
|
public String bytedance(HttpServletRequest request,
|
|
|
HttpServletResponse response,
|
|
|
@RequestParam("auth_code") String authCode,
|
|
|
- @RequestParam("state") String state, @RequestParam("accountId") String accountId) {
|
|
|
+ @RequestParam("state") String state) {
|
|
|
System.out.println(request.getQueryString());
|
|
|
if (StringUtils.isNotBlank(authCode)) {
|
|
|
- System.out.println(this.getByteDanceAccessToken(authCode, accountId, state));
|
|
|
+ System.out.println(this.getByteDanceAccessToken(authCode, state));
|
|
|
return "auth_success";
|
|
|
}
|
|
|
return "auth_fail";
|
|
|
}
|
|
|
|
|
|
- public String getByteDanceAccessToken(String authCode, String accountId, String state) {
|
|
|
+ public String getByteDanceAccessToken(String authCode, String state) {
|
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
|
param.put("app_id", PropertiesUtils.getValue("bytedance_config", "bytedance_appid"));
|
|
|
param.put("secret", PropertiesUtils.getValue("bytedance_config", "bytedance_secret"));
|
|
@@ -146,10 +146,10 @@ public class CallbackController {
|
|
|
Integer code = resultObject.getInteger("code");
|
|
|
String message = resultObject.getString("message");
|
|
|
if (null == code || code != 0) {
|
|
|
- logger.info("获取token失败,accountId:{},message:{}", accountId, message);
|
|
|
+ logger.info("获取token失败,state:{},message:{}", state, message);
|
|
|
}
|
|
|
JSONObject data = resultObject.getJSONObject("data");
|
|
|
- CTopOauthToken token = new CTopOauthToken(accountId, data);
|
|
|
+ CTopOauthToken token = new CTopOauthToken(data.getString("advertiser_id"), data);
|
|
|
if (Check.isNull(token)) {
|
|
|
AuthTask authTask = authTaskService.getAuthTask(state);
|
|
|
if (Check.isNull(authTask)) {
|
|
@@ -168,12 +168,12 @@ public class CallbackController {
|
|
|
userAllocation.setAccountId(token.getAccountId());
|
|
|
allocationMapper.deleteById(userAllocation.getId());
|
|
|
Map<String, Object> deleteUserMap = new HashMap<>();
|
|
|
- deleteUserMap.put("account_id", accountId);
|
|
|
+ deleteUserMap.put("account_id", token.getAccountId());
|
|
|
deleteUserMap.put("advertiser_id", advertiserId);
|
|
|
allocationMapper.deleteByMap(deleteUserMap);
|
|
|
int i = allocationMapper.insert(userAllocation);
|
|
|
if (i > 0) {
|
|
|
- logger.info("同步分配用户表完成,task_id:{},accountId:{}", state, accountId);
|
|
|
+ logger.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
|
|
|
|
|
|
}
|
|
|
}
|