diff --git a/src/api/auth.ts b/src/api/auth.ts index 7ec7a9eb..1545b4a8 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -3,6 +3,20 @@ import Cookies from 'js-cookie' import type { loginDataTypes } from '@/types/auth' import { useMemberStore } from '@/stores/member' +export const postPasswordEmailSend = async (name: string, email: string) => { + const request = { + name: name, + email: email + } + const response = await axiosInstance.post('/api/new-password', request) + return response.data +} + +export const postPasswordCheck = async (password: string) => { + const response = await axiosInstance.post('/api/members/password', { password: password }) + return response.data +} + export const postLogin = async (loginData: loginDataTypes) => { const response = await axiosInstance.post('/api/auths/login', loginData) Cookies.set('accessToken', response.data.accessToken, { @@ -17,7 +31,8 @@ export const postLogin = async (loginData: loginDataTypes) => { } export const patchPassword = async (password: string) => { - const response = await axiosInstance.patch('/api/members/password', password) + const request = { password: password } + const response = await axiosInstance.patch('/api/members/password', request) return response.data } diff --git a/src/components/EditInformation.vue b/src/components/EditInformation.vue index c913ef9a..b5eceec3 100644 --- a/src/components/EditInformation.vue +++ b/src/components/EditInformation.vue @@ -7,6 +7,15 @@ + + + + +

프로필 사진

+ v-model="name" />

아이디

@@ -55,17 +64,17 @@

알림 수신 여부

+ :isChecked="agitCheck" /> + :isChecked="kakaoWorkCheck" /> + :isChecked="emailCheck" />
@@ -86,7 +95,7 @@ diff --git a/src/views/PwChangeEmail.vue b/src/views/PwChangeEmail.vue index 9b94a9aa..eac7f4f5 100644 --- a/src/views/PwChangeEmail.vue +++ b/src/views/PwChangeEmail.vue @@ -3,51 +3,33 @@ + @close="closeModal">
+ content="가입된 이메일과 이름을 입력해주세요" />
- -
-
-
- -
-
+
@@ -66,25 +48,19 @@ import { ref } from 'vue' import router from '../router/index' import ModalView from '../components/ModalView.vue' import TitleContainer from '@/components/common/TitleContainer.vue' +import { postPasswordEmailSend } from '@/api/auth' -const id = ref('') +const name = ref('') const email = ref('') -const checkCode = ref('') -const requestEmail = ref(false) const isModalOpen = ref(false) -const toggleModal = () => { +const closeModal = () => { isModalOpen.value = !isModalOpen.value -} - -const handleRequestEmail = () => { - toggleModal() - requestEmail.value = true - // 이메일 인증 코드 전송 API 추가 필요 + router.push('/login') } const handleCheck = () => { - // 이메일 인증 코드 확인 API 추가 필요 - router.push('/pw-change') + postPasswordEmailSend(name.value, email.value) + isModalOpen.value = !isModalOpen.value } diff --git a/src/views/PwCheck.vue b/src/views/PwCheck.vue index 264511f5..4c28c7f2 100644 --- a/src/views/PwCheck.vue +++ b/src/views/PwCheck.vue @@ -3,7 +3,7 @@
+ :content="'비밀번호 재설정을 위해\n 현재 비밀번호를 입력해주세요'" />
{ - // 기존 비밀번호 확인 API 추가 필요 + postPasswordCheck(pw.value) router.push('/pw-change') }