1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-13 04:01:40 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

第三方登录添加飞书

This commit is contained in:
2022-04-04 21:24:21 +08:00
parent d78e1c6661
commit f17a0a0a25
3 changed files with 16 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
<button type="button" onclick="thirdPartyLogin('gitee')">Gitee</button>
<button type="button" onclick="thirdPartyLogin('OSCHINA')">OSCHINA</button>
<button type="button" onclick="thirdPartyLogin('feishu')">飞书</button>
<button type="button" onclick="thirdPartyLogin('qq')">QQ</button>
<script>
// 第三方授权登录逻辑

View File

@@ -24,6 +24,14 @@ public class ThirdPartyConfig {
@Value("${thirdparty.oschina.redirecturi}")
private String oschinaRedirecturi;
// 飞书
@Value("${thirdparty.feishu.clientid}")
private String feishuClientId;
@Value("${thirdparty.feishu.clientsecret}")
private String feishuClientsecret;
@Value("${thirdparty.feishu.redirecturi}")
private String feishuRedirecturi;
// QQ
@Value("${thirdparty.qq.clientid}")
private String qqClientid;

View File

@@ -6,9 +6,7 @@ import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.request.AuthGiteeRequest;
import me.zhyd.oauth.request.AuthOschinaRequest;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.request.*;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.apache.tomcat.jni.User;
import org.springframework.beans.factory.annotation.Autowired;
@@ -100,6 +98,12 @@ public class ThirdPartyController extends BaseController {
.clientSecret(thirdPartyConfig.getOschinaClientsecret())
.redirectUri(thirdPartyConfig.getOschinaRedirecturi())
.build());
case "feishu":
return new AuthFeishuRequest(AuthConfig.builder()
.clientId(thirdPartyConfig.getFeishuClientId())
.clientSecret(thirdPartyConfig.getFeishuClientsecret())
.redirectUri(thirdPartyConfig.getFeishuRedirecturi())
.build());
case "qq":
return new AuthGiteeRequest(AuthConfig.builder()
.clientId(thirdPartyConfig.getQqClientid())