From b87d7a3b2c163992edbdf0e27b8dfcd9d1528aa9 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Fri, 31 Jul 2020 09:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0-=E6=8E=88=E6=9D=83=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/AppLetAuthorizationController.java | 9 +++------ .../com/epmet/service/AppLetAuthorizationService.java | 2 +- .../service/impl/AppLetAuthorizationServiceImpl.java | 5 +++-- .../java/com/epmet/wxapi/constant/WxMaCodeConstant.java | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java index 0ef2d05e5a..64a4bb3376 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java @@ -10,10 +10,7 @@ import com.epmet.dto.form.RemoveBindFormDTO; import com.epmet.dto.result.GoToAuthResultDTO; import com.epmet.service.AppLetAuthorizationService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * @Author zxc @@ -32,9 +29,9 @@ public class AppLetAuthorizationController { * @author zxc */ @PostMapping("gotoauth") - public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO){ + public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO, @RequestHeader("source")String source){ ValidatorUtils.validateEntity(formDTO); - GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO); + GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO,source); return new Result().ok(goToAuthResultDTO); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java index fd659764b9..0d00e16505 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java @@ -17,7 +17,7 @@ public interface AppLetAuthorizationService { * @param tokenDto * @author zxc */ - GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO); + GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO,String source); /** * @Description 将公众号/小程序从开放平台帐号下解绑 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java index dd50366b48..d64dab83c4 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java @@ -55,12 +55,13 @@ public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationServic * @author zxc */ @Override - public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO) { + public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO,String source) { GoToAuthResultDTO result = new GoToAuthResultDTO(); String userId = tokenDto.getUserId(); //获取预授权码 String preAuthCode = componentVerifyTicketService.preAuthCode(); - String redirectUrl = WxMaCodeConstant.WEB_URL + formDTO.getClientType(); +// String redirectUrl = WxMaCodeConstant.WEB_URL + formDTO.getClientType(); + String redirectUrl = String.format(WxMaCodeConstant.WEB_URL,source,formDTO.getClientType()); String authUrl = String.format(WxMaCodeConstant.API_AUTH_REGISTER_URL, componentAppId, preAuthCode, redirectUrl); result.setUrl(authUrl); return result; diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 6d82fae8da..75ce684c49 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -33,7 +33,7 @@ public interface WxMaCodeConstant { /** * 前端地址 【授权之后的跳转的地址】 */ - String WEB_URL = "https://epmet-cloud.elinkservice.cn/third/mpweb/page/#/info?clientType="; + String WEB_URL = "https://epmet-cloud.elinkservice.cn/third/mpweb/page/%s/#/info?clientType=%s"; /** * 授权注册页面扫码授权