|
|
@@ -88,7 +88,7 @@ public class AuthorizationController {
|
|
|
private final UserDistributePopularizeMapper distributePopularizeMapper;
|
|
|
|
|
|
@GetMapping(value = "/weChat")
|
|
|
- public void base(String url, String dsCode, Long sharedId, Integer dsType, Long popularizeId, String authType, HttpServletResponse response) throws Exception {
|
|
|
+ public void base(String url, String dsCode, Long sharedId, Integer dsType, Long popularizeId, String authType, String callbackType, String callback, HttpServletResponse response) throws Exception {
|
|
|
|
|
|
log.info("微信授权转跳. url: {},authType:{}", url, authType);
|
|
|
|
|
|
@@ -101,7 +101,9 @@ public class AuthorizationController {
|
|
|
if (StrUtil.isNotBlank(dsCode)) {
|
|
|
dsCode = dsCode.trim();
|
|
|
}
|
|
|
- AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId).setSharedId(sharedId).setDsType(dsType).setPid(popularizeId).setDsCode(dsCode);
|
|
|
+ AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId).setSharedId(sharedId).setDsType(dsType).setPid(popularizeId).setDsCode(dsCode)
|
|
|
+ .setCallback(callback)
|
|
|
+ .setCallbackType(callbackType);
|
|
|
String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
|
|
|
|
|
|
response.sendRedirect(authorizationService.createUrl(state, authType));
|
|
|
@@ -200,7 +202,7 @@ public class AuthorizationController {
|
|
|
* 网页微信授权登录
|
|
|
*/
|
|
|
@GetMapping("/wx/authLogin")
|
|
|
- public Result<String> wxAuthorize(Long sharedId, Integer dsType, Long popularizeId, String dsCode, String type) throws Exception {
|
|
|
+ public Result<String> wxAuthorize(Long sharedId, Integer dsType, Long popularizeId, String dsCode, String type, String callbackType, String callback) throws Exception {
|
|
|
String wxAuthUrl = redisService.getStr(RedisService.key.WX_LOGIN_AUTH_URI.getNameFormat(wxOpenPlatYHLXLoginConfig.getAppId()));
|
|
|
Long mappingId = SEQUENCE.nextId();
|
|
|
String loginUrl = wxOpenPlatYHLXLoginConfig.getLoginUrl();
|
|
|
@@ -211,7 +213,9 @@ public class AuthorizationController {
|
|
|
if (StrUtil.isNotBlank(dsCode)) {
|
|
|
dsCode = dsCode.trim();
|
|
|
}
|
|
|
- AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId).setSharedId(sharedId).setDsType(dsType).setPid(popularizeId).setDsCode(dsCode);
|
|
|
+ AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId).setSharedId(sharedId).setDsType(dsType).setPid(popularizeId).setDsCode(dsCode)
|
|
|
+ .setCallback(callback)
|
|
|
+ .setCallbackType(callbackType);
|
|
|
String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
|
|
|
if (StrUtil.isEmpty(wxAuthUrl)) {
|
|
|
wxAuthUrl = authorizationService.createWxAuthLoginUrl(state, false);
|