
--- client/views/pages/user/MyInfo.vue
+++ client/views/pages/user/MyInfo.vue
... | ... | @@ -106,31 +106,33 @@ |
106 | 106 |
this.isPasswordValid = passwordRegex.test(this.userPassword.newPassword); |
107 | 107 |
}, |
108 | 108 |
async fnDeleteUser() { |
109 |
- try { |
|
110 |
- this.userInfo.userSttus = "0"; |
|
111 |
- this.userInfo.useAt = "N"; |
|
112 |
- // 사용자 정보를 업데이트하는 API 호출 |
|
113 |
- const response = await updateUsers(this.$store.state.userId, this.userInfo); |
|
109 |
+ if (confirm("회원탈퇴를 하시겠습니까?")) { |
|
110 |
+ try { |
|
111 |
+ this.userInfo.userSttus = "0"; |
|
112 |
+ this.userInfo.useAt = "N"; |
|
113 |
+ // 사용자 정보를 업데이트하는 API 호출 |
|
114 |
+ const response = await updateUsers(this.$store.state.userId, this.userInfo); |
|
114 | 115 |
|
115 |
- console.log(response); // 응답 확인 |
|
116 |
+ console.log(response); // 응답 확인 |
|
116 | 117 |
|
117 |
- if (response.status === 200) { |
|
118 |
- logOutProc() |
|
119 |
- .then(() => { |
|
120 |
- console.log('로그아웃 성공 - 서버 측 쿠키 삭제 완료'); |
|
121 |
- this.$store.commit('setStoreReset'); // 로그아웃 성공 후 스토어 초기화 |
|
122 |
- this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트 |
|
123 |
- }) |
|
124 |
- .catch(err => { |
|
125 |
- console.error('로그아웃 처리 중 오류:', err); |
|
126 |
- this.$store.commit('setStoreReset'); // 오류가 있어도 스토어는 초기화 |
|
127 |
- this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트 |
|
128 |
- }); |
|
118 |
+ if (response.status === 200) { |
|
119 |
+ logOutProc() |
|
120 |
+ .then(() => { |
|
121 |
+ console.log('로그아웃 성공 - 서버 측 쿠키 삭제 완료'); |
|
122 |
+ this.$store.commit('setStoreReset'); // 로그아웃 성공 후 스토어 초기화 |
|
123 |
+ this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트 |
|
124 |
+ }) |
|
125 |
+ .catch(err => { |
|
126 |
+ console.error('로그아웃 처리 중 오류:', err); |
|
127 |
+ this.$store.commit('setStoreReset'); // 오류가 있어도 스토어는 초기화 |
|
128 |
+ this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트 |
|
129 |
+ }); |
|
130 |
+ } |
|
131 |
+ } catch (error) { |
|
132 |
+ console.error("User error:", error); // 에러 로그 |
|
133 |
+ const message = error.response?.data?.message || "회원탈퇴퇴에 실패했습니다."; |
|
134 |
+ alert(message); |
|
129 | 135 |
} |
130 |
- } catch (error) { |
|
131 |
- console.error("User error:", error); // 에러 로그 |
|
132 |
- const message = error.response?.data?.message || "회원탈퇴퇴에 실패했습니다."; |
|
133 |
- alert(message); |
|
134 | 136 |
} |
135 | 137 |
}, |
136 | 138 |
//사용자 이름 벨류데이션 체크 |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?