bug
jiangqs
2023-07-25 3b09eb084576dd6be9a7b342edf345293bcc6459
ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java
@@ -37,8 +37,11 @@
    @Autowired
    private TokenService tokenService;
    @Value("${h5.redirectUriBase}")
    private String redirectUriBase;
    @Value("${h5.redirectMerchantUriBase}")
    private String redirectMerchantUriBase;
    @Value("${h5.redirectEmployeeUriBase}")
    private String redirectEmployeeUriBase;
    /**
@@ -51,7 +54,17 @@
    @ApiOperation("构造网页授权链接")
    public R<OauthUrlVo> oauthUrl(@ApiParam(value = "授权重定向地址", required = true) @RequestParam("redirectUri") String redirectUri) throws UnsupportedEncodingException {
        // 普通应用
        redirectUri = redirectUriBase + redirectUri;
        redirectUri = redirectMerchantUriBase + redirectUri;
        String oauthRedirectUrl =  URLEncoder.encode(redirectUri,"utf-8");
        String oauthUrl = qywxInnerService.getOauthUrl(oauthRedirectUrl);
        return R.ok(new OauthUrlVo(oauthUrl));
    }
    @GetMapping({"/h5/oauthStaffUrl"})
    @ApiOperation("构造网页授权链接")
    public R<OauthUrlVo> oauthStaffUrl(@ApiParam(value = "授权重定向地址", required = true) @RequestParam("redirectUri") String redirectUri) throws UnsupportedEncodingException {
        // 普通应用
        redirectUri = redirectEmployeeUriBase + redirectUri;
        String oauthRedirectUrl =  URLEncoder.encode(redirectUri,"utf-8");
        String oauthUrl = qywxInnerService.getOauthUrl(oauthRedirectUrl);
        return R.ok(new OauthUrlVo(oauthUrl));