|
|
@@ -215,6 +215,30 @@ public class AuthorizationController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(wxAuthUrl);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 不同域名跳转 微信授权登录
|
|
|
+ */
|
|
|
+ @GetMapping("/do/wx/authLogin/")
|
|
|
+ public Result<String> doWxAuthorize(Long sharedId, Integer dsType, Long popularizeId, String dsCode, String type, String loginUrl, String callbackType, String callback) throws Exception {
|
|
|
+ Long mappingId = SEQUENCE.nextId();
|
|
|
+ if (StrUtil.isEmpty(loginUrl)) {
|
|
|
+ loginUrl = wxOpenPlatYHLXLoginConfig.getLoginUrl();
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(type)) {
|
|
|
+ loginUrl = String.format("https://nf.video/%s/web", type);
|
|
|
+ }
|
|
|
+ redisService.set(mappingId.toString(), loginUrl, 60 * 60 * 24L);
|
|
|
+ if (StrUtil.isNotBlank(dsCode)) {
|
|
|
+ dsCode = dsCode.trim();
|
|
|
+ }
|
|
|
+ AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId).setSharedId(sharedId).setDsType(dsType).setPid(popularizeId).setDsCode(dsCode)
|
|
|
+ .setCk(callback)
|
|
|
+ .setCt(callbackType);
|
|
|
+ String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
|
|
|
+ String wxAuthUrl = authorizationService.createWxAuthLoginUrl(state, wxOpenPlatYHLXLoginConfig.getRedirectUri());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(wxAuthUrl);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 网页微信授权后跳转
|
|
|
*/
|