Skip to content

Commit

Permalink
📝 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyd-c committed Jan 7, 2020
1 parent 2a9d8e8 commit 6439058
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
5 changes: 3 additions & 2 deletions docs/oauth/alipay.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
```java
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthAlipayRequest;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -143,9 +144,9 @@ public class RestAuthController {
}

@RequestMapping("/callback")
public Object login(String code) {
public Object login(AuthCallback callback) {
AuthRequest authRequest = getAuthRequest();
return authRequest.login(code);
return authRequest.login(callback);
}

private AuthRequest getAuthRequest() {
Expand Down
5 changes: 3 additions & 2 deletions docs/oauth/gitee.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
```java
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthGiteeRequest;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -86,9 +87,9 @@ public class RestAuthController {
}

@RequestMapping("/callback")
public Object login(String code) {
public Object login(AuthCallback callback) {
AuthRequest authRequest = getAuthRequest();
return authRequest.login(code);
return authRequest.login(callback);
}

private AuthRequest getAuthRequest() {
Expand Down
5 changes: 3 additions & 2 deletions docs/oauth/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
```java
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthGithubRequest;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -83,9 +84,9 @@ public class RestAuthController {
}

@RequestMapping("/callback")
public Object login(String code) {
public Object login(AuthCallback callback) {
AuthRequest authRequest = getAuthRequest();
return authRequest.login(code);
return authRequest.login(callback);
}

private AuthRequest getAuthRequest() {
Expand Down
5 changes: 3 additions & 2 deletions docs/oauth/kujiale.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ String authorizeUrl = authRequest.authorize(String state, String scopeStr);
```java
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthKujialeRequest;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.request.AuthRequest;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -101,10 +102,10 @@ public class RestAuthController {
}

@RequestMapping("/callback")
public Object login(String code, String state) {
public Object login(AuthCallback callback) {
AuthRequest authRequest = getAuthRequest();
//此处如果对安全性有要求,请校验state参数
return authRequest.login(code);
return authRequest.login(callback);
}

private AuthRequest getAuthRequest() {
Expand Down
5 changes: 3 additions & 2 deletions docs/oauth/qq.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
```java
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthQqRequest;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -76,9 +77,9 @@ public class RestAuthController {
}

@RequestMapping("/callback")
public Object login(String code) {
public Object login(AuthCallback callback) {
AuthRequest authRequest = getAuthRequest();
return authRequest.login(code);
return authRequest.login(callback);
}

private AuthRequest getAuthRequest() {
Expand Down
5 changes: 3 additions & 2 deletions docs/oauth/wechat_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
```java
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthWeChatOpenRequest;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -101,9 +102,9 @@ public class RestAuthController {
}

@RequestMapping("/callback")
public Object login(String code) {
public Object login(AuthCallback callback) {
AuthRequest authRequest = getAuthRequest();
return authRequest.login(code);
return authRequest.login(callback);
}

private AuthRequest getAuthRequest() {
Expand Down
6 changes: 4 additions & 2 deletions docs/oauth/weibo.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
```java
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthWeiboRequest;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -85,9 +87,9 @@ public class RestAuthController {
}

@RequestMapping("/callback")
public Object login(String code) {
public Object login(AuthCallback callback) {
AuthRequest authRequest = getAuthRequest();
return authRequest.login(code);
return authRequest.login(callback);
}

@RequestMapping("/revoke/{token}")
Expand Down

0 comments on commit 6439058

Please sign in to comment.