오타 수정 및 아이디 길이 체크 추가

This commit is contained in:
yoon 2025-03-31 12:21:57 +09:00
parent 5b82d3d315
commit ceada27663

View File

@ -252,8 +252,15 @@
profile.value = file;
};
//
//
const checkIdDuplicate = async () => {
//
if (id.value.length < 4) {
idError.value = '아이디는 4자리 이상이어야 합니다.';
idErrorAlert.value = true;
return;
}
const response = await $api.get(`/user/checkId?memberIds=${id.value}`);
if (!response.data.data) {
idErrorAlert.value = true;
@ -331,6 +338,16 @@
}
};
watch(id, (newValue) => {
if (newValue && newValue.length >= 4) {
idError.value = '';
idErrorAlert.value = false;
} else if (newValue && newValue.length < 4) {
idError.value = '아이디는 4자리 이상이어야 합니다.';
idErrorAlert.value = true;
}
});
watch(password, (newValue) => {
if (newValue && newValue.length >= 4) {
passwordErrorAlert.value = false;
@ -355,7 +372,13 @@
addressAlert.value = address.value.trim() === '';
phoneAlert.value = phone.value.trim() === '';
//
//
if (id.value && id.value.length < 4) {
idErrorAlert.value = true;
idError.value = '아이디는 4자리 이상이어야 합니다.';
}
//
if (password.value && password.value.length < 4) {
passwordErrorAlert.value = true;
passwordError.value = '비밀번호는 4자리 이상이어야 합니다.';
@ -383,7 +406,7 @@
idAlert.value ||
idErrorAlert.value ||
passwordAlert.value ||
passwordcErrorAlert.value ||
passwordErrorAlert.value ||
passwordcheckAlert.value ||
passwordcheckErrorAlert.value ||
pwhintResAlert.value ||