Skip to content

Commit

Permalink
✨ spring-boot-demo-social 小米 登录完成
Browse files Browse the repository at this point in the history
  • Loading branch information
xkcoding committed May 30, 2019
1 parent e933932 commit 715275d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public Dict loginType() {
.set("GitHub登录", "http://oauth.xkcoding.com/demo/oauth/login/github")
.set("微信登录", "http://oauth.xkcoding.com/demo/oauth/login/wechat")
.set("Google登录", "http://oauth.xkcoding.com/demo/oauth/login/google")
.set("Microsoft 登录", "http://oauth.xkcoding.com/demo/oauth/login/microsoft");
.set("Microsoft 登录", "http://oauth.xkcoding.com/demo/oauth/login/microsoft")
.set("小米登录", "http://oauth.xkcoding.com/demo/oauth/login/mi");
}

/**
Expand Down Expand Up @@ -86,6 +87,8 @@ private AuthRequest getAuthRequest(String oauthType) {
return getGoogleAuthRequest();
case MICROSOFT:
return getMicrosoftAuthRequest();
case MI:
return getMiAuthRequest();
default:
throw new RuntimeException("暂不支持的第三方登录");
}
Expand All @@ -110,4 +113,8 @@ private AuthRequest getGoogleAuthRequest() {
private AuthRequest getMicrosoftAuthRequest() {
return new AuthMicrosoftRequest(properties.getMicrosoft());
}

private AuthRequest getMiAuthRequest() {
return new AuthMiRequest(properties.getMi());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ public class OAuthProperties {
* Microsoft 配置
*/
private AuthConfig microsoft;

/**
* Mi 配置
*/
private AuthConfig mi;
}
4 changes: 4 additions & 0 deletions spring-boot-demo-social/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ oauth:
client-id: 7bdce818-2c8e-4b**************
client-secret: Iu0zZ43RQydo_FkD**************
redirect-uri: https://oauth.xkcoding.com/demo/oauth/microsoft/callback
mi:
client-id: 2882303**************
client-secret: nFeTt89Yn**************
redirect-uri: http://oauth.xkcoding.com/demo/oauth/mi/callback

0 comments on commit 715275d

Please sign in to comment.