|
1 | 1 | <script lang="ts" setup>
|
2 |
| -import { WechatOutlined } from '@ant-design/icons-vue' |
| 2 | +import { WechatOutlined, QqCircleFilled, GithubFilled } from '@ant-design/icons-vue' |
3 | 3 | import { gsap } from 'gsap'
|
4 | 4 | import { getCaptcha, registerApi } from './api'
|
5 | 5 | import { useUserStore } from '@/stores/modules/user'
|
6 | 6 | import Motion from '@/components/functional/Motion'
|
7 |
| -
|
8 | 7 | const user = useUserStore()
|
9 | 8 | // const { tt } = useLocalI18n()
|
10 | 9 | const state = reactive<ILoginForm>({
|
@@ -41,7 +40,21 @@ async function getImg() {
|
41 | 40 | console.trace(error)
|
42 | 41 | }
|
43 | 42 | }
|
44 |
| -
|
| 43 | +// 触发 QQ 登录 |
| 44 | +const qqLogin = () => { |
| 45 | + if (window.QC) { |
| 46 | + window.QC.Login.showPopup() // 显示 QQ 登录窗口 |
| 47 | + } else { |
| 48 | + console.error('QQ SDK 未加载') |
| 49 | + } |
| 50 | +} |
| 51 | +// 触发 gitHub 登录 |
| 52 | +const loginGithub = () => { |
| 53 | + const authorize_uri = 'https://github.com/login/oauth/authorize' |
| 54 | + const client_id = 'Ov23liKReLQSwNqVFcak' |
| 55 | + const redirect_url = 'http://localhost:3005/login' |
| 56 | + window.location.href = `${authorize_uri}?client_id=${client_id}&redirect_url=${redirect_url}` |
| 57 | +} |
45 | 58 | onMounted(() => {
|
46 | 59 | gsap.to('.img', {
|
47 | 60 | rotation: 55, // 顺时针旋转90度
|
@@ -111,6 +124,8 @@ onMounted(() => {
|
111 | 124 | <div class="extra-login">
|
112 | 125 | <a>
|
113 | 126 | <wechat-outlined style="font-size: 40px; color: #24bf24" />
|
| 127 | + <QqCircleFilled style="font-size: 38px; color: #4da4de; margin-left: 20px" @click="qqLogin" /> |
| 128 | + <GithubFilled style="font-size: 36px; color: #000; margin: 0px 0 0px 20px" @click="loginGithub" /> |
114 | 129 | </a>
|
115 | 130 | </div>
|
116 | 131 | </a-form-item>
|
@@ -301,8 +316,8 @@ onMounted(() => {
|
301 | 316 |
|
302 | 317 | h2 {
|
303 | 318 | text-align: center;
|
| 319 | + text-shadow: 0 1px 2px 0 rgb(135 76 255 / 30%); |
304 | 320 | letter-spacing: 0.02em;
|
305 |
| - text-shadow: 0 1px 2px rgb(135 76 255 / 30%); |
306 | 321 | background: linear-gradient(98deg, #741bfe 0%, #f224fd 54%, #fc4b34 100%);
|
307 | 322 | background-clip: text;
|
308 | 323 | -webkit-text-fill-color: transparent;
|
|
0 commit comments