diff --git a/src/components/user/FindPassword.vue b/src/components/user/FindPassword.vue
index bef2c59..0260908 100644
--- a/src/components/user/FindPassword.vue
+++ b/src/components/user/FindPassword.vue
@@ -40,10 +40,11 @@
@update:alert="pwhintResAlert = $event"
:value="pwhintRes"
/>
-
@@ -29,7 +30,6 @@
diff --git a/src/components/user/RegisterForm.vue b/src/components/user/RegisterForm.vue
index 1924e21..2953ea3 100644
--- a/src/components/user/RegisterForm.vue
+++ b/src/components/user/RegisterForm.vue
@@ -141,9 +141,11 @@
:is-alert="phoneAlert"
@update:data="phone = $event"
@update:alert="phoneAlert = $event"
+ @blur="checkPhoneDuplicate"
:maxlength="11"
:value="phone"
/>
+
{{ phoneError }}
취소
@@ -181,6 +183,7 @@
const detailAddress = ref('');
const postcode = ref(''); // 우편번호
const phone = ref('');
+ const phoneError = ref('');
const color = ref(''); // 선택된 color
const mbti = ref(''); // 선택된 MBTI
const pwhint = ref(''); // 선택된 pwhint
@@ -196,6 +199,7 @@
const birthAlert = ref(false);
const addressAlert = ref(false);
const phoneAlert = ref(false);
+ const phoneErrorAlert = ref(false);
const toastStore = useToastStore();
@@ -251,6 +255,19 @@
}
};
+ // 전화번호 중복체크
+ const checkPhoneDuplicate = async () => {
+ const response = await $api.get(`/user/checkPhone?memberTel=${phone.value}`);
+
+ if (!response.data.data) {
+ phoneErrorAlert.value = true;
+ phoneError.value = '이미 사용 중인 전화번호입니다.';
+ } else {
+ phoneErrorAlert.value = false;
+ phoneError.value = '';
+ }
+ };
+
// 컬러, mbti, 비밀번호 힌트 목록 불러오기
const { colorList, mbtiList, pwhintList } = commonApi({
loadColor: true, colorType: 'YON',
@@ -298,7 +315,7 @@
}
if (profilAlert.value || idAlert.value || idErrorAlert.value || passwordAlert.value || passwordcheckAlert.value ||
- passwordcheckErrorAlert.value || pwhintResAlert.value || nameAlert.value || birthAlert.value || addressAlert.value || phoneAlert.value) {
+ passwordcheckErrorAlert.value || pwhintResAlert.value || nameAlert.value || birthAlert.value || addressAlert.value || phoneAlert.value || phoneErrorAlert.value) {
return;
}