비밀번호 4자리 alert

This commit is contained in:
yoon 2025-03-25 17:43:24 +09:00
parent 44de501340
commit cf52ab8a1b

View File

@ -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 ||