feat: implement QR code scan login system with admin control

- Add scan login service with Redis-based token management
- Add scan login API routes for token generation and validation
- Add QRCodeLogin component for PC-side QR code display
- Add EntryQRCode component for mass login scenarios
- Add ScanLoginView for mobile-side login form
- Add localStorage persistence for user identity
- Add logout functionality to mobile client
- Add auto-redirect for logged-in users
- Add admin console control for QR code display on big screen
- Add socket event forwarding from admin to screen display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-01-25 21:44:52 +08:00
parent 75570af8bc
commit f4736b6ebd
26 changed files with 1925 additions and 119 deletions

View File

@@ -32,6 +32,9 @@ export const useDisplayStore = defineStore('display', () => {
avatar?: string;
} | null>(null);
// QR Code display state (controlled by admin)
const showEntryQR = ref(false);
// Computed
const connectionStatus = computed(() => {
if (isConnected.value) return 'connected';
@@ -131,6 +134,17 @@ export const useDisplayStore = defineStore('display', () => {
}
});
// QR Code display control events
socketInstance.on('display:show_entry_qr' as any, () => {
console.log('[Screen] Show entry QR code');
showEntryQR.value = true;
});
socketInstance.on('display:hide_qr' as any, () => {
console.log('[Screen] Hide QR code');
showEntryQR.value = false;
});
socket.value = socketInstance as GalaSocket;
}
@@ -169,6 +183,7 @@ export const useDisplayStore = defineStore('display', () => {
isDrawing,
currentPrize,
currentWinner,
showEntryQR,
// Computed
connectionStatus,