하석형 하석형 04-09
250409 하석형 AppStore 로그아웃 전 Context Path 저장 및 로그아웃 시 Context Path 로그인 페이지로 이동
@832f76e848992a147da2434c0e8d9f04d83a1f37
client/views/pages/AppStore.js
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.js
@@ -68,6 +68,7 @@
   actions: {
     async logout({ commit }) {
       try {
+        const ctx = this.state.contextPath; // 캐시 초기화 전 contextPath 저장
         const res = await logOutProc();
         alert(res.data.message);
         if (res.status == 200) {
@@ -81,7 +82,7 @@
           document.cookie = "refresh=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
           document.cookie = "Authorization=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
           // 4. 로그인 페이지로 이동
-          window.location = state.contextPath + "/login.page";
+          window.location = ctx + "/login.page";
         }
       } catch(error) {
         const errorData = error.response.data;
Add a comment
List