|
@@ -6,6 +6,7 @@ import com.sxtvs.open.api.odata.dto.wx.WxApiCreatePreAuthCodeRequest;
|
|
|
import com.sxtvs.open.api.odata.dto.wx.WxApiCreatePreAuthCodeResponse;
|
|
|
import com.sxtvs.open.api.youmei.service.YoumeiAccountServiceImpl;
|
|
|
import com.sxtvs.open.core.conf.OauthConfig;
|
|
|
+import com.sxtvs.open.core.sls.AliyunLogger;
|
|
|
import lombok.SneakyThrows;
|
|
|
import org.apache.hc.client5.http.fluent.Request;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -27,6 +28,9 @@ public class OauthService {
|
|
|
@Autowired
|
|
|
private StringRedisTemplate redisTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AliyunLogger logger;
|
|
|
+
|
|
|
@SneakyThrows
|
|
|
public String getWeiboUrl() {
|
|
|
var accessToken = youmeiAccountService.getSxgdAccount().getAccessToken();
|
|
@@ -40,6 +44,7 @@ public class OauthService {
|
|
|
return objectMapper.readTree(body).get("data").get("auth_url").asText();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@SneakyThrows
|
|
|
public WxApiCreatePreAuthCodeResponse createPreAuthCodeResponse() {
|
|
|
var ticket = redisTemplate.opsForValue().get("WX_TICKET");
|
|
@@ -51,6 +56,7 @@ public class OauthService {
|
|
|
.execute()
|
|
|
.returnContent()
|
|
|
.asString(StandardCharsets.UTF_8);
|
|
|
+ logger.info("微信获取preauthcode {}", body);
|
|
|
|
|
|
return objectMapper.readValue(body, WxApiCreatePreAuthCodeResponse.class);
|
|
|
}
|