-
-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Oauth | ||
|
||
## The system offer google and github Oauth log in by default | ||
|
||
### How to get clientID and client secret? | ||
[google](https://developers.google.com/identity/protocols/oauth2) | ||
[github](https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps) | ||
|
||
### Add provider | ||
|
||
![picture](../../assets/oauth_add_provider_en.png) | ||
|
||
### Edit src/views/sys/login/LoginForm.vue | ||
|
||
```html | ||
<div class="flex justify-evenly enter-x" :class="`${prefixCls}-sign-in-way`"> | ||
<GithubFilled @click="oauthLoginHandler('github')" /> | ||
<WechatFilled /> | ||
<AlipayCircleFilled /> | ||
<GoogleCircleFilled @click="oauthLoginHandler('google')" /> | ||
<TwitterCircleFilled /> | ||
</div> | ||
``` | ||
|
||
Add icon and click event with the provider name。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Oauth | ||
|
||
## 目前系统已默认提供 google 和 github Oauth 登录功能 | ||
|
||
### 如何获取 clientID 和 client secret? | ||
[google](https://developers.google.com/identity/protocols/oauth2) | ||
[github](https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps) | ||
|
||
### 添加第三方 | ||
|
||
![picture](../../assets/oauth_add_provider.png) | ||
|
||
### 编辑 src/views/sys/login/LoginForm.vue | ||
|
||
```html | ||
<div class="flex justify-evenly enter-x" :class="`${prefixCls}-sign-in-way`"> | ||
<GithubFilled @click="oauthLoginHandler('github')" /> | ||
<WechatFilled /> | ||
<AlipayCircleFilled /> | ||
<GoogleCircleFilled @click="oauthLoginHandler('google')" /> | ||
<TwitterCircleFilled /> | ||
</div> | ||
``` | ||
|
||
添加对应的provider名称即可。 |