| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Value("${h5.redirectUriBase}") |
| | | private String redirectUriBase; |
| | | |
| | | |
| | | /** |
| | | * 构造网页授权链接 |
| | |
| | | @ApiOperation("构造网页授权链接") |
| | | public R<OauthUrlVo> oauthUrl(@ApiParam(value = "授权重定向地址", required = true) @RequestParam("redirectUri") String redirectUri) throws UnsupportedEncodingException { |
| | | // 普通应用 |
| | | redirectUri = redirectUriBase + redirectUri; |
| | | String oauthRedirectUrl = URLEncoder.encode(redirectUri,"utf-8"); |
| | | String oauthUrl = qywxInnerService.getOauthUrl(oauthRedirectUrl); |
| | | return R.ok(new OauthUrlVo(oauthUrl)); |