This commit is contained in:
2026-01-30 17:20:52 +09:00
commit 21b6332c9c
459 changed files with 190743 additions and 0 deletions

36
kngil/js/login.js Normal file
View File

@@ -0,0 +1,36 @@
const form = document.querySelector('.tab-content.id form')
if (form) {
form.addEventListener('submit', async (e) => {
e.preventDefault()
const id = document.getElementById('login_id').value.trim()
const pw = document.getElementById('login_password').value.trim()
if (!id || !pw) {
alert('아이디와 비밀번호를 입력하세요.')
return
}
try {
const res = await fetch('/kngil/bbs/login.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id, pw })
})
console.log('login.js loaded')
const json = await res.json()
if (json.status === 'success') {
console.log('LOGIN OK, reload')
document.getElementById('pop_login').style.display = 'none'
location.reload()
} else {
alert(json.message)
}
} catch (err) {
console.error(err)
alert('로그인 중 오류가 발생했습니다.')
}
})
}