| | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Value("${h5.redirectUriBase}") |
| | | private String redirectUriBase; |
| | | @Value("${h5.redirectMerchantUriBase}") |
| | | private String redirectMerchantUriBase; |
| | | |
| | | @Value("${h5.redirectEmployeeUriBase}") |
| | | private String redirectEmployeeUriBase; |
| | | |
| | | |
| | | /** |
| | |
| | | @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)); |