비밀번호 4자리 alert
This commit is contained in:
parent
44de501340
commit
cf52ab8a1b
@ -38,6 +38,7 @@
|
||||
@update:alert="passwordAlert = $event"
|
||||
:value="password"
|
||||
/>
|
||||
<span v-if="passwordError" class="invalid-feedback d-block">{{ passwordError }}</span>
|
||||
|
||||
<UserFormInput
|
||||
title="비밀번호 확인"
|
||||
@ -180,6 +181,7 @@
|
||||
const id = ref('');
|
||||
const idError = ref('');
|
||||
const password = ref('');
|
||||
const passwordError = ref('');
|
||||
const passwordcheck = ref('');
|
||||
const passwordcheckError = ref('');
|
||||
const pwhintRes = ref('');
|
||||
@ -199,6 +201,7 @@
|
||||
const idAlert = ref(false);
|
||||
const idErrorAlert = ref(false);
|
||||
const passwordAlert = ref(false);
|
||||
const passwordErrorAlert = ref(false);
|
||||
const passwordcheckAlert = ref(false);
|
||||
const passwordcheckErrorAlert = ref(false); // 비밀번호 확인 오류 메시지
|
||||
const pwhintResAlert = ref(false);
|
||||
@ -328,11 +331,17 @@
|
||||
}
|
||||
};
|
||||
|
||||
watch(password, (newValue) => {
|
||||
if (newValue.length >= 4) {
|
||||
passwordErrorAlert.value = false;
|
||||
passwordError.value = '';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 회원가입
|
||||
const handleSubmit = async () => {
|
||||
await checkColorDuplicate();
|
||||
|
||||
idAlert.value = id.value.trim() === '';
|
||||
passwordAlert.value = password.value.trim() === '';
|
||||
passwordcheckAlert.value = passwordcheck.value.trim() === '';
|
||||
@ -342,6 +351,14 @@
|
||||
addressAlert.value = address.value.trim() === '';
|
||||
phoneAlert.value = phone.value.trim() === '';
|
||||
|
||||
// 비밀번호 길이 체크 로직 추가
|
||||
if (password.value.length < 4) {
|
||||
passwordErrorAlert.value = true;
|
||||
passwordError.value = '비밀번호는 4자리 이상이어야 합니다.';
|
||||
} else {
|
||||
passwordError.value = '';
|
||||
}
|
||||
|
||||
if (!/^\d+$/.test(phone.value)) {
|
||||
phoneAlert.value = true;
|
||||
} else {
|
||||
@ -362,6 +379,7 @@
|
||||
idAlert.value ||
|
||||
idErrorAlert.value ||
|
||||
passwordAlert.value ||
|
||||
passwordcErrorAlert.value ||
|
||||
passwordcheckAlert.value ||
|
||||
passwordcheckErrorAlert.value ||
|
||||
pwhintResAlert.value ||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user