비밀번호 힌트 공통에서 받아오는 걸로 변경

This commit is contained in:
yoon 2025-02-06 09:24:01 +09:00
parent ffd23da7f4
commit 0a91dbef09

View File

@ -58,9 +58,11 @@
:is-essential="true" :is-essential="true"
:is-row="false" :is-row="false"
:is-label="true" :is-label="true"
:is-common="true"
:data="pwhintList" :data="pwhintList"
@update:data="pwhint = $event" @update:data="pwhint = $event"
/> />
<UserFormInput <UserFormInput
title="답변" title="답변"
name="pwhintRes" name="pwhintRes"
@ -152,8 +154,9 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue'; import { ref } from 'vue';
import $api from '@api'; import $api from '@api';
import commonApi from '@/common/commonApi'
import UserFormInput from '@c/input/UserFormInput.vue'; import UserFormInput from '@c/input/UserFormInput.vue';
import FormSelect from '@c/input/FormSelect.vue'; import FormSelect from '@c/input/FormSelect.vue';
import ArrInput from '@c/input/ArrInput.vue'; import ArrInput from '@c/input/ArrInput.vue';
@ -161,8 +164,6 @@
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useToastStore } from '@s/toastStore'; import { useToastStore } from '@s/toastStore';
const pwhintList = ['현재 살고 있는 동네', '가장 기억에 남는 책', '좋아하는 음식'];
const router = useRouter(); const router = useRouter();
const profile = ref(null); const profile = ref(null);
@ -173,7 +174,6 @@
const password = ref(''); const password = ref('');
const passwordcheck = ref(''); const passwordcheck = ref('');
const passwordcheckError = ref(''); const passwordcheckError = ref('');
const pwhint = ref(0);
const pwhintRes = ref(''); const pwhintRes = ref('');
const name = ref(''); const name = ref('');
const birth = ref(''); const birth = ref('');
@ -181,10 +181,9 @@
const detailAddress = ref(''); const detailAddress = ref('');
const postcode = ref(''); // const postcode = ref(''); //
const phone = ref(''); const phone = ref('');
const colorList = ref([]);
const mbtiList = ref([]);
const color = ref(''); // color const color = ref(''); // color
const mbti = ref(''); // MBTI const mbti = ref(''); // MBTI
const pwhint = ref(''); // pwhint
const profilAlert = ref(false); const profilAlert = ref(false);
const idAlert = ref(false); const idAlert = ref(false);
@ -252,27 +251,8 @@
} }
}; };
const Colors = async () => { // , mbti,
const response = await $api.get('/user/color'); const { colorList, mbtiList, pwhintList } = commonApi();
colorList.value = response.data.data.map(item => ({
label: item.CMNCODNAM,
value: item.CMNCODVAL
}));
};
const Mbtis = async () => {
const response = await $api.get('/user/mbti');
mbtiList.value = response.data.data.map(item => ({
label: item.CMNCODNAM,
value: item.CMNCODVAL
}));
};
onMounted(() => {
Colors();
Mbtis();
});
// //
const handleAddressUpdate = (addressData) => { const handleAddressUpdate = (addressData) => {
@ -321,7 +301,7 @@
const formData = new FormData(); const formData = new FormData();
formData.append('memberIds', id.value); formData.append('memberIds', id.value);
formData.append('memberPwd', password.value); formData.append('memberPwd', password.value);
formData.append('memberPwh', pwhintList[pwhint.value]); formData.append('memberPwh', pwhint.value);
formData.append('memberPwr', pwhintRes.value); formData.append('memberPwr', pwhintRes.value);
formData.append('memberNam', name.value); formData.append('memberNam', name.value);
formData.append('memberArr', address.value); formData.append('memberArr', address.value);