mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-16 05:10:34 +00:00
fix
This commit is contained in:
parent
3fdd187102
commit
d59e5f2133
@ -4,31 +4,17 @@
|
|||||||
<h2 class="sotheby-font">QQ Login</h2>
|
<h2 class="sotheby-font">QQ Login</h2>
|
||||||
<div class="login-methods">
|
<div class="login-methods">
|
||||||
<t-tooltip content="快速登录">
|
<t-tooltip content="快速登录">
|
||||||
<t-button
|
<t-button id="quick-login" class="login-method" :class="{ active: loginMethod === 'quick' }"
|
||||||
id="quick-login"
|
@click="loginMethod = 'quick'">Quick Login</t-button>
|
||||||
class="login-method"
|
|
||||||
:class="{ active: loginMethod === 'quick' }"
|
|
||||||
@click="loginMethod = 'quick'"
|
|
||||||
>Quick Login</t-button
|
|
||||||
>
|
|
||||||
</t-tooltip>
|
</t-tooltip>
|
||||||
<t-tooltip content="二维码登录">
|
<t-tooltip content="二维码登录">
|
||||||
<t-button
|
<t-button id="qrcode-login" class="login-method" :class="{ active: loginMethod === 'qrcode' }"
|
||||||
id="qrcode-login"
|
@click="loginMethod = 'qrcode'">QR Code</t-button>
|
||||||
class="login-method"
|
|
||||||
:class="{ active: loginMethod === 'qrcode' }"
|
|
||||||
@click="loginMethod = 'qrcode'"
|
|
||||||
>QR Code</t-button
|
|
||||||
>
|
|
||||||
</t-tooltip>
|
</t-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="loginMethod === 'quick'" id="quick-login-dropdown" class="login-form">
|
<div v-show="loginMethod === 'quick'" id="quick-login-dropdown" class="login-form">
|
||||||
<t-select
|
<t-select id="quick-login-select" v-model="selectedAccount" placeholder="Select Account"
|
||||||
id="quick-login-select"
|
@change="selectAccount">
|
||||||
v-model="selectedAccount"
|
|
||||||
placeholder="Select Account"
|
|
||||||
@change="selectAccount"
|
|
||||||
>
|
|
||||||
<t-option v-for="account in quickLoginList" :key="account" :value="account">{{ account }}</t-option>
|
<t-option v-for="account in quickLoginList" :key="account" :value="account">{{ account }}</t-option>
|
||||||
</t-select>
|
</t-select>
|
||||||
</div>
|
</div>
|
||||||
@ -41,7 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, onBeforeUnmount } from 'vue';
|
||||||
import * as QRCode from 'qrcode';
|
import * as QRCode from 'qrcode';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { MessagePlugin } from 'tdesign-vue-next';
|
import { MessagePlugin } from 'tdesign-vue-next';
|
||||||
@ -104,18 +90,28 @@ const InitPages = async (): Promise<void> => {
|
|||||||
quickLoginList.value = await qqLoginManager.getQQQuickLoginList();
|
quickLoginList.value = await qqLoginManager.getQQQuickLoginList();
|
||||||
qrcodeUrl = await qqLoginManager.getQQLoginQrcode();
|
qrcodeUrl = await qqLoginManager.getQQLoginQrcode();
|
||||||
generateQrCode(qrcodeUrl, qrcodeCanvas.value);
|
generateQrCode(qrcodeUrl, qrcodeCanvas.value);
|
||||||
heartBeatTimer = window.setInterval(HeartBeat, 3000);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
InitPages();
|
InitPages().then().catch((err) => {
|
||||||
|
console.error('InitPages Error:', err);
|
||||||
|
});
|
||||||
|
heartBeatTimer = window.setInterval(HeartBeat, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
if (heartBeatTimer) {
|
||||||
|
clearInterval(heartBeatTimer);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.layout {
|
.layout {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-container {
|
.login-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user