feat: implement lobby functionality with user and server information retrieval

This commit is contained in:
2026-01-03 13:35:16 +00:00
parent 1988e180c5
commit 67d995c65f
14 changed files with 328 additions and 17 deletions
+24 -4
View File
@@ -1,13 +1,33 @@
<script setup lang="ts">
import { ref } from 'vue';
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import DefaultLayout from '../layouts/DefaultLayout.vue';
import { trpc } from '../utils/trpc';
const router = useRouter();
const username = ref('');
const password = ref('');
const handleLogin = () => {
console.log('Login attempt:', username.value);
// tRPC 호출 로직이 들어갈 자리
onMounted(async () => {
try {
const me = await trpc.me.query();
if (me) {
router.push('/lobby');
}
} catch (e) {
// Not logged in or error
}
});
const handleLogin = async () => {
try {
// TODO: Implement login mutation
// const result = await trpc.auth.login.mutation({ username: username.value, password: password.value });
// if (result.success) router.push('/lobby');
console.log('Login attempt:', username.value);
} catch (e) {
alert('로그인 실패');
}
};
const handleJoin = () => {