We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-oauth2/sa-token-demo-oauth2-client/src/main/java/com/pj/oauth2/SaOAuthClientController.java
// 根据 Access-Token 置换相关的资源: 获取账号昵称、头像、性别等信息 @RequestMapping("/getUserinfo") public SaResult getUserinfo(String accessToken) throws JsonProcessingException { // 调用Server端接口,查询开放的资源 String str = OkHttps.sync(serverUrl + "/oauth2/userinfo") .addBodyPara("access_token", accessToken) .post() .getBody() .toString(); SoMap so = SoMap.getSoMap().setJsonString(str); System.out.println("返回结果: " + new ObjectMapper().writeValueAsString(so));
The text was updated successfully, but these errors were encountered:
看到了,你的代码里有了
https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-oauth2/sa-token-demo-oauth2-server/src/main/java/com/pj/oauth2/SaOAuth2ServerController.java
Sorry, something went wrong.
No branches or pull requests
https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-oauth2/sa-token-demo-oauth2-client/src/main/java/com/pj/oauth2/SaOAuthClientController.java
// 根据 Access-Token 置换相关的资源: 获取账号昵称、头像、性别等信息
@RequestMapping("/getUserinfo")
public SaResult getUserinfo(String accessToken) throws JsonProcessingException {
// 调用Server端接口,查询开放的资源
String str = OkHttps.sync(serverUrl + "/oauth2/userinfo")
.addBodyPara("access_token", accessToken)
.post()
.getBody()
.toString();
SoMap so = SoMap.getSoMap().setJsonString(str);
System.out.println("返回结果: " + new ObjectMapper().writeValueAsString(so));
The text was updated successfully, but these errors were encountered: