오타 수정 및 아이디 길이 체크 추가
This commit is contained in:
parent
5b82d3d315
commit
ceada27663
@ -252,8 +252,15 @@
|
|||||||
profile.value = file;
|
profile.value = file;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 아이디 중복체크
|
// 아이디 체크
|
||||||
const checkIdDuplicate = async () => {
|
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}`);
|
const response = await $api.get(`/user/checkId?memberIds=${id.value}`);
|
||||||
if (!response.data.data) {
|
if (!response.data.data) {
|
||||||
idErrorAlert.value = true;
|
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) => {
|
watch(password, (newValue) => {
|
||||||
if (newValue && newValue.length >= 4) {
|
if (newValue && newValue.length >= 4) {
|
||||||
passwordErrorAlert.value = false;
|
passwordErrorAlert.value = false;
|
||||||
@ -355,7 +372,13 @@
|
|||||||
addressAlert.value = address.value.trim() === '';
|
addressAlert.value = address.value.trim() === '';
|
||||||
phoneAlert.value = phone.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) {
|
if (password.value && password.value.length < 4) {
|
||||||
passwordErrorAlert.value = true;
|
passwordErrorAlert.value = true;
|
||||||
passwordError.value = '비밀번호는 4자리 이상이어야 합니다.';
|
passwordError.value = '비밀번호는 4자리 이상이어야 합니다.';
|
||||||
@ -383,7 +406,7 @@
|
|||||||
idAlert.value ||
|
idAlert.value ||
|
||||||
idErrorAlert.value ||
|
idErrorAlert.value ||
|
||||||
passwordAlert.value ||
|
passwordAlert.value ||
|
||||||
passwordcErrorAlert.value ||
|
passwordErrorAlert.value ||
|
||||||
passwordcheckAlert.value ||
|
passwordcheckAlert.value ||
|
||||||
passwordcheckErrorAlert.value ||
|
passwordcheckErrorAlert.value ||
|
||||||
pwhintResAlert.value ||
|
pwhintResAlert.value ||
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user