릴리스: v0.1.12 작성 권한과 회원 관리 보강

This commit is contained in:
2026-03-19 16:44:50 +09:00
parent c71a19873d
commit f6a031cfe4
14 changed files with 372 additions and 26 deletions

View File

@@ -2,9 +2,11 @@
import { computed, onMounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { api } from '../lib/api'
import { useAuthStore } from '../stores/auth'
const route = useRoute()
const router = useRouter()
const auth = useAuthStore()
const gameId = computed(() => route.params.gameId)
@@ -34,6 +36,10 @@ onMounted(async () => {
})
function createNew() {
if (!auth.user) {
router.push(`/login?redirect=/editor/${gameId.value}/new`)
return
}
router.push(`/editor/${gameId.value}/new`)
}
@@ -50,7 +56,7 @@ function openTierList(id) {
<p class="desc"> 티어표를 만들거나, 다른 사람들이 올린 티어표를 확인하세요.</p>
</div>
<div class="head__right">
<button class="primary" @click="createNew">새로운 티어표 만들기</button>
<button class="primary" @click="createNew">{{ auth.user ? '새로운 티어표 만들기' : '로그인 티어표 만들기' }}</button>
</div>
</section>