File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed
Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 4949 <dependency >
5050 <groupId >me.zhyd.oauth</groupId >
5151 <artifactId >JustAuth</artifactId >
52- <version >1.0.1 </version >
52+ <version >1.2.0 </version >
5353 </dependency >
5454
5555 <dependency >
Original file line number Diff line number Diff line change @@ -26,4 +26,5 @@ public class OAuthProperties {
2626 * github 配置
2727 */
2828 private CommonProperties github ;
29+ private CommonProperties wechat ;
2930}
Original file line number Diff line number Diff line change 88import me .zhyd .oauth .model .AuthSource ;
99import me .zhyd .oauth .request .AuthGithubRequest ;
1010import me .zhyd .oauth .request .AuthRequest ;
11+ import me .zhyd .oauth .request .AuthWeChatRequest ;
1112import org .springframework .beans .factory .annotation .Autowired ;
1213import org .springframework .web .bind .annotation .PathVariable ;
1314import org .springframework .web .bind .annotation .RequestMapping ;
@@ -66,6 +67,8 @@ private AuthRequest getAuthRequest(String oauthType) {
6667 switch (authSource ) {
6768 case GITHUB :
6869 return getGithubAuthRequest ();
70+ case WECHAT :
71+ return getWechatAuthRequest ();
6972 default :
7073 throw new RuntimeException ("暂不支持的第三方登录" );
7174 }
@@ -75,6 +78,10 @@ private AuthRequest getGithubAuthRequest() {
7578 return new AuthGithubRequest (buildAuthConfig (properties .getGithub ()));
7679 }
7780
81+ private AuthRequest getWechatAuthRequest () {
82+ return new AuthWeChatRequest (buildAuthConfig (properties .getWechat ()));
83+ }
84+
7885 private AuthConfig buildAuthConfig (CommonProperties properties ) {
7986 return AuthConfig .builder ()
8087 .clientId (properties .getClientId ())
Original file line number Diff line number Diff line change 77 github :
88 client-id : 2d25a70d12e3d5f01086
99 client-secret : 5a2919b5fe911567343aea2ccc7a5ad7871306d1
10- redirect-uri : http://oauth.xkcoding.com/demo/oauth/github/callback
10+ redirect-uri : http://oauth.xkcoding.com/demo/oauth/github/callback
11+ wechat :
12+ client-id :
13+ client-secret :
14+ redirect-uri : http://oauth.xkcoding.com/demo/oauth/wechat/callback
You can’t perform that action at this time.
0 commit comments