From 09a665d0798dae33bc67fb3c1185a613ff5842f3 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Thu, 13 Mar 2025 19:03:43 +0900 Subject: [PATCH] =?UTF-8?q?front=20public=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/RegisterForm.vue | 63 ++++++++++++++++------------ 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/src/components/user/RegisterForm.vue b/src/components/user/RegisterForm.vue index 2acce37..719cf6b 100644 --- a/src/components/user/RegisterForm.vue +++ b/src/components/user/RegisterForm.vue @@ -5,7 +5,7 @@ for="profilePic" class="rounded-circle m-auto ui-bg-cover position-relative cursor-pointer" id="profileLabel" - style="width: 100px; height: 100px; background-image: url(public/img/avatars/default-Profile.jpg); background-repeat: no-repeat;" + style="width: 100px; height: 100px; background-image: url(img/avatars/default-Profile.jpg); background-repeat: no-repeat" > @@ -53,14 +53,14 @@ {{ passwordcheckError }} import { ref } from 'vue'; import $api from '@api'; - import commonApi from '@/common/commonApi' + import commonApi from '@/common/commonApi'; import UserFormInput from '@c/input/UserFormInput.vue'; import FormSelect from '@c/input/FormSelect.vue'; import ArrInput from '@c/input/ArrInput.vue'; @@ -185,13 +185,13 @@ const birth = ref(''); const address = ref(''); const detailAddress = ref(''); - const postcode = ref(''); // 우편번호 + const postcode = ref(''); // 우편번호 const phone = ref(''); const phoneError = ref(''); const color = ref(''); // 선택된 color const colorError = ref(''); - const mbti = ref(''); // 선택된 MBTI - const pwhint = ref(''); // 선택된 pwhint + const mbti = ref(''); // 선택된 MBTI + const pwhint = ref(''); // 선택된 pwhint const profilAlert = ref(false); const idAlert = ref(false); @@ -209,7 +209,6 @@ const toastStore = useToastStore(); - // 프로필 체크 const profileValid = (size, type) => { const maxSize = 5 * 1024 * 1024; @@ -238,7 +237,7 @@ // 사이즈, 파일 타입 안 맞으면 기본 이미지 if (!profileValid(file.size, file.type)) { e.target.value = ''; - profileLabel.style.backgroundImage = 'url("public/img/avatars/default-Profile.jpg")'; + profileLabel.style.backgroundImage = 'url("img/avatars/default-Profile.jpg")'; return false; } @@ -275,16 +274,17 @@ // 컬러, mbti, 비밀번호 힌트 목록 불러오기 const { colorList, mbtiList, pwhintList } = commonApi({ - loadColor: true, colorType: 'YON', + loadColor: true, + colorType: 'YON', loadMbti: true, loadPwhint: true, }); // 주소 업데이트 핸들러 - const handleAddressUpdate = (addressData) => { + const handleAddressUpdate = addressData => { address.value = addressData.address; detailAddress.value = addressData.detailAddress; - postcode.value = addressData.postcode; // 우편번호 + postcode.value = addressData.postcode; // 우편번호 }; // 비밀번호 확인 체크 @@ -311,18 +311,16 @@ } }; - const handleColorUpdate = async (newColor) => { + const handleColorUpdate = async newColor => { color.value = newColor; colorError.value = ''; colorErrorAlert.value = false; await checkColorDuplicate(); - } - + }; // 회원가입 const handleSubmit = async () => { - await checkColorDuplicate(); idAlert.value = id.value.trim() === ''; @@ -343,9 +341,21 @@ profilAlert.value = false; } - if (profilAlert.value || idAlert.value || idErrorAlert.value || passwordAlert.value || passwordcheckAlert.value || - passwordcheckErrorAlert.value || pwhintResAlert.value || nameAlert.value || birthAlert.value || - addressAlert.value || phoneAlert.value || phoneErrorAlert.value || colorErrorAlert.value) { + if ( + profilAlert.value || + idAlert.value || + idErrorAlert.value || + passwordAlert.value || + passwordcheckAlert.value || + passwordcheckErrorAlert.value || + pwhintResAlert.value || + nameAlert.value || + birthAlert.value || + addressAlert.value || + phoneAlert.value || + phoneErrorAlert.value || + colorErrorAlert.value + ) { return; } @@ -364,7 +374,7 @@ formData.append('memberMbt', mbti.value); formData.append('memberPrf', profile.value); - const response = await $api.post('/user/join', formData, { isFormData : true }); + const response = await $api.post('/user/join', formData, { isFormData: true }); if (response.status === 200) { toastStore.onToast('등록신청이 완료되었습니다. 관리자 승인 후 이용가능합니다.', 's'); @@ -372,4 +382,3 @@ } }; -