yjryu / KERIS star
류윤주 류윤주 2023-11-30
231130 이세현 쿠키 수정
@adc13197c97dd8486e06b81df0e670aa16a07051
client/views/pages/user/main/Main.vue
--- client/views/pages/user/main/Main.vue
+++ client/views/pages/user/main/Main.vue
@@ -380,7 +380,7 @@
             swiper: null,
             store: useStore(),
             popupList: [],
-            showPopup: false
+            showPopup: true
         }
     },
     methods: {
@@ -393,8 +393,9 @@
         },
 
         checkPopupStatus() {
-            // 쿠키가 설정되어 있으면 팝업을 감춥니다.
-            if (Cookies.get('popupClosed')) {
+            const popupClosed = Cookies.get('popupClosed') === 'true';
+            console.log("popupClosed", popupClosed);
+            if (popupClosed) {
                 this.showPopup = false;
             }
         },
@@ -402,6 +403,7 @@
             // 'popupClosed' 쿠키를 1일(24시간) 동안 설정합니다.
             Cookies.set('popupClosed', true, { expires: 1 });
             this.showPopup = false;
+            console.log("this.showPopup",this.showPopup)
         },
 
         // 페이지 준비중 alert
@@ -550,8 +552,11 @@
                 },
             }).then(function (response) {
                 vm.popupList = response.data;
-                if (vm.popupList.length > 0) {
-                    vm.showPopup = true
+                // if (vm.popupList.length > 0) {
+                //     vm.showPopup = true
+                // }
+                if(vm.popupList.length <0){
+                    vm.showPopup = false;
                 }
                 console.log("vm.popupList", vm.popupList)
             }).catch(function (error) {
Add a comment
List