|
@@ -14,6 +14,7 @@ import com.sxtvs.open.api.odata.wxutil.WxXmlUtil;
|
|
|
import com.sxtvs.open.core.advice.NoAPIResponse;
|
|
|
import com.sxtvs.open.core.auth.HttpContextUtil;
|
|
|
import com.sxtvs.open.core.auth.LoginRequired;
|
|
|
+import com.sxtvs.open.core.conf.Constant;
|
|
|
import com.sxtvs.open.core.conf.OauthConfig;
|
|
|
import com.sxtvs.open.core.sls.AliyunLogger;
|
|
|
import jakarta.annotation.Resource;
|
|
@@ -39,7 +40,10 @@ public class OauthRestController {
|
|
|
@Autowired
|
|
|
private OauthService oauthService;
|
|
|
|
|
|
- @RequestMapping("weixin/auth/v2")
|
|
|
+ @Autowired
|
|
|
+ private WxTicketService wxTicketService;
|
|
|
+
|
|
|
+ @RequestMapping("weixin/auth")
|
|
|
@NoAPIResponse
|
|
|
public String authV2(@RequestBody String body) {
|
|
|
logger.info("body", body, "key", "oauth/weixin/auth");
|
|
@@ -50,28 +54,19 @@ public class OauthRestController {
|
|
|
String componentVerifyTicket = WxXmlUtil.getComponentVerifyTicket(xml);
|
|
|
logger.debug("data", componentVerifyTicket);
|
|
|
redisTemplate.opsForValue().set("WX_TICKET", componentVerifyTicket);
|
|
|
- return "success";
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private WxTicketService wxTicketService;
|
|
|
|
|
|
- @RequestMapping("weixin/auth")
|
|
|
- @NoAPIResponse
|
|
|
- public String auth(@RequestBody String body) {
|
|
|
- logger.info("body {} ", body);
|
|
|
- String xml = WxCrypt.decrypt(WxXmlUtil.getEncrypt(body));
|
|
|
- String componentVerifyTicket = WxXmlUtil.getComponentVerifyTicket(xml);
|
|
|
- logger.info("weixin componentVerifyTicket {}", componentVerifyTicket);
|
|
|
+ //老逻辑,更库
|
|
|
WxTicket wxTicket = new WxTicket();
|
|
|
wxTicket.setId(1);
|
|
|
wxTicket.setTicket(componentVerifyTicket);
|
|
|
wxTicket.setUpdateTime(new Date());
|
|
|
|
|
|
wxTicketService.updateById(wxTicket);
|
|
|
+
|
|
|
return "success";
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@RequestMapping("douyin/code")
|
|
|
@LoginRequired
|
|
|
public RedirectDto douyinQrCode() {
|
|
@@ -93,7 +88,7 @@ public class OauthRestController {
|
|
|
logger.info("key", "oauth/douyin/code", "state", state, "token", token);
|
|
|
oauthService.saveStateMapping(token, state);
|
|
|
return new RedirectDto("http://open.kuaishou.com/oauth2/connect?" +
|
|
|
- "app_id=" + OauthConfig.kuaishouClientKey + "&response_type=code&" +
|
|
|
+ "app_id=" + Constant.kuaishouClientKey + "&response_type=code&" +
|
|
|
"scope=user_info%2Cuser_video_info&" +
|
|
|
"redirect_uri=http%3A%2F%2Fimport.smcic.net%2Fkuaishou%2Fcallback&state=" + state);
|
|
|
|