하관우 하관우 04-14
2025-04-14 하관우 회원탈퇴 팝업 수정정
@00028d897713423f770c226c678c58845fedff25
client/views/pages/user/MyInfo.vue
--- client/views/pages/user/MyInfo.vue
+++ client/views/pages/user/MyInfo.vue
@@ -106,31 +106,33 @@
             this.isPasswordValid = passwordRegex.test(this.userPassword.newPassword);
         },
         async fnDeleteUser() {
-            try {
-                this.userInfo.userSttus = "0";
-                this.userInfo.useAt = "N";
-                // 사용자 정보를 업데이트하는 API 호출
-                const response = await updateUsers(this.$store.state.userId, this.userInfo);
+            if (confirm("회원탈퇴를 하시겠습니까?")) {
+                try {
+                    this.userInfo.userSttus = "0";
+                    this.userInfo.useAt = "N";
+                    // 사용자 정보를 업데이트하는 API 호출
+                    const response = await updateUsers(this.$store.state.userId, this.userInfo);
 
-                console.log(response); // 응답 확인
+                    console.log(response); // 응답 확인
 
-                if (response.status === 200) {
-                    logOutProc()
-                        .then(() => {
-                            console.log('로그아웃 성공 - 서버 측 쿠키 삭제 완료');
-                            this.$store.commit('setStoreReset'); // 로그아웃 성공 후 스토어 초기화
-                            this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트
-                        })
-                        .catch(err => {
-                            console.error('로그아웃 처리 중 오류:', err);
-                            this.$store.commit('setStoreReset'); // 오류가 있어도 스토어는 초기화
-                            this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트
-                        });
+                    if (response.status === 200) {
+                        logOutProc()
+                            .then(() => {
+                                console.log('로그아웃 성공 - 서버 측 쿠키 삭제 완료');
+                                this.$store.commit('setStoreReset'); // 로그아웃 성공 후 스토어 초기화
+                                this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트
+                            })
+                            .catch(err => {
+                                console.error('로그아웃 처리 중 오류:', err);
+                                this.$store.commit('setStoreReset'); // 오류가 있어도 스토어는 초기화
+                                this.$router.push({ path: '/Login.page' }); // 로그인 페이지로 리다이렉트
+                            });
+                    }
+                } catch (error) {
+                    console.error("User error:", error); // 에러 로그
+                    const message = error.response?.data?.message || "회원탈퇴퇴에 실패했습니다.";
+                    alert(message);
                 }
-            } catch (error) {
-                console.error("User error:", error); // 에러 로그
-                const message = error.response?.data?.message || "회원탈퇴퇴에 실패했습니다.";
-                alert(message);
             }
         },
         //사용자 이름 벨류데이션 체크
Add a comment
List