@@ -2,8 +2,6 @@ package com.iformall.service.toutiao.api.bean; | |||||
import com.google.gson.Gson; | import com.google.gson.Gson; | ||||
import com.google.gson.GsonBuilder; | import com.google.gson.GsonBuilder; | ||||
import com.iformall.service.toutiao.miniapp.bean.TtMaSubscribeMessage; | |||||
import com.iformall.service.toutiao.miniapp.bean.TtMaSubscribeMessageGsonAdapter; | |||||
/** | /** | ||||
* @author | * @author | ||||
@@ -198,7 +198,8 @@ public class TtOpenComponentServiceImpl implements TtOpenComponentService { | |||||
JsonObject jsonObject = new JsonObject(); | JsonObject jsonObject = new JsonObject(); | ||||
jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId()); | jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId()); | ||||
String responseContent = post(API_CREATE_PREAUTHCODE_URL, jsonObject.toString(),"component_access_token"); | String responseContent = post(API_CREATE_PREAUTHCODE_URL, jsonObject.toString(),"component_access_token"); | ||||
jsonObject = WxGsonBuilder.create().fromJson(responseContent, JsonObject.class); | |||||
log.info(responseContent +"----------responseContent"); | |||||
jsonObject = TtOpenGsonBuilder.create().fromJson(responseContent, JsonObject.class); | |||||
StringBuilder preAuthUrl = new StringBuilder(String.format(COMPONENT_LOGIN_PAGE_URL, | StringBuilder preAuthUrl = new StringBuilder(String.format(COMPONENT_LOGIN_PAGE_URL, | ||||
getWxOpenConfigStorage().getComponentAppId(), | getWxOpenConfigStorage().getComponentAppId(), | ||||
@@ -56,7 +56,6 @@ public class TtAuthController { | |||||
@GetMapping("/goto_auth_url") | @GetMapping("/goto_auth_url") | ||||
public void gotoPreAuthUrl(HttpServletRequest request, HttpServletResponse response) { | public void gotoPreAuthUrl(HttpServletRequest request, HttpServletResponse response) { | ||||
String host = request.getHeader("host"); | String host = request.getHeader("host"); | ||||
logger.info("-----host="+host); | |||||
String url = "https://" + host + "/T/wt_auth/jump"; | String url = "https://" + host + "/T/wt_auth/jump"; | ||||
try { | try { | ||||
url = openService.getTtOpenComponentService().getPreAuthUrl(url); | url = openService.getTtOpenComponentService().getPreAuthUrl(url); | ||||