기능검증 중

This commit is contained in:
2026-01-11 12:59:21 +09:00
parent d4620dc1fa
commit 1f9745fdfc
14 changed files with 2000 additions and 88 deletions

View File

@@ -361,6 +361,10 @@ const vcsForm = ref({ serverId: '', vcsUsername: '', vcsEmail: '', authType: 'pa
const isEditing = ref(false)
const isSaving = ref(false)
// 비밀번호 변경 관련
const pwForm = ref({ currentPassword: '', newPassword: '', confirmPassword: '' })
const isChangingPw = ref(false)
const editForm = ref({
employeeName: '',
company: '',
@@ -511,4 +515,35 @@ async function deleteVcsAccount(account: any) {
alert(e.data?.message || '삭제에 실패했습니다.')
}
}
// 비밀번호 변경
async function changePassword() {
if (!pwForm.value.newPassword || pwForm.value.newPassword.length < 8) {
alert('새 비밀번호는 8자 이상이어야 합니다.')
return
}
if (pwForm.value.newPassword !== pwForm.value.confirmPassword) {
alert('새 비밀번호가 일치하지 않습니다.')
return
}
isChangingPw.value = true
try {
await $fetch('/api/auth/change-password', {
method: 'POST',
body: {
currentPassword: pwForm.value.currentPassword || null,
newPassword: pwForm.value.newPassword,
confirmPassword: pwForm.value.confirmPassword
}
})
alert('비밀번호가 변경되었습니다.')
pwForm.value = { currentPassword: '', newPassword: '', confirmPassword: '' }
loadUserInfo()
} catch (e: any) {
alert(e.data?.message || '비밀번호 변경에 실패했습니다.')
} finally {
isChangingPw.value = false
}
}
</script>