跳至主要內容

第三方登陆

Ryan SU小于 1 分钟

目前系统已默认提供 google 和 github Oauth 登录功能

如何获取 clientID 和 client secret? googleopen in new windowgithubopen in new window

添加第三方

picture
picture

编辑 src/views/sys/login/LoginForm.vue

<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 名称即可。 param 模式是将请求放在网址中 header 模式是将请求放在 authorization 内