浏览代码

fix 微信授权回传参数接收

zoujiajian 3 年之前
父节点
当前提交
ce5ea51c9b
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

+ 8 - 4
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -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);