

250516 김혜민 타임아웃으로 인한 로그아웃 에러 수정
@3ec7036e8fefeb98deca6cf0692614afa4ffe1ce
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
... | ... | @@ -168,31 +168,34 @@ |
168 | 168 |
const AppRouter = createRouter({ history: createWebHistory(), routes, }); |
169 | 169 |
|
170 | 170 |
AppRouter.beforeEach(async (to, from, next) => { |
171 |
- const userId = store.state.loginUser; |
|
172 |
- if (userId == null) { |
|
173 |
- if (to.path == "/login.page") { |
|
174 |
- next(); |
|
175 |
- } else { |
|
176 |
- axios({ |
|
177 |
- url: "/getLoginInfo.json", |
|
178 |
- method: "post", |
|
179 |
- headers: { "Content-Type": "application/json; charset=UTF-8" }, |
|
180 |
- }) |
|
181 |
- .then(function (response) { |
|
182 |
- if (response.data.checkMessage.status > 0) { |
|
183 |
- store.commit("setLoginUser", response.data.resultData.LoginUserInfo); |
|
184 |
- userAuthCheck(to, from, next); |
|
185 |
- } else { |
|
186 |
- next("/login.page"); |
|
187 |
- } |
|
188 |
- }) |
|
189 |
- .catch(function (error) { |
|
190 |
- alert("에러가 발생했습니다. 관리자에게 문의해 주세요."); |
|
191 |
- }); |
|
192 |
- } |
|
193 |
- } else { |
|
194 |
- userAuthCheck(to, from, next); |
|
171 |
+ // 로그인 페이지는 항상 접근 가능 |
|
172 |
+ if (to.path == "/login.page") { |
|
173 |
+ return next(); |
|
195 | 174 |
} |
175 |
+ |
|
176 |
+ // 모든 페이지 이동 시 로그인 상태 체크 (세션 만료 체크 포함) |
|
177 |
+ axios({ |
|
178 |
+ url: "/getLoginInfo.json", |
|
179 |
+ method: "post", |
|
180 |
+ headers: { "Content-Type": "application/json; charset=UTF-8" }, |
|
181 |
+ }) |
|
182 |
+ .then(function (response) { |
|
183 |
+ if (response.data.checkMessage.status > 0) { |
|
184 |
+ // 로그인 정보 갱신 |
|
185 |
+ store.commit("setLoginUser", response.data.resultData.LoginUserInfo); |
|
186 |
+ // 권한 체크 후 라우팅 |
|
187 |
+ userAuthCheck(to, from, next); |
|
188 |
+ } else { |
|
189 |
+ // 로그인 상태가 아니거나 세션이 만료된 경우 |
|
190 |
+ store.commit("setLoginUser", null); // 로그인 정보 초기화 |
|
191 |
+ next("/login.page"); |
|
192 |
+ } |
|
193 |
+ }) |
|
194 |
+ .catch(function (error) { |
|
195 |
+ alert("에러가 발생했습니다. 관리자에게 문의해 주세요."); |
|
196 |
+ store.commit("setLoginUser", null); // 로그인 정보 초기화 |
|
197 |
+ next("/login.page"); |
|
198 |
+ }); |
|
196 | 199 |
}); |
197 | 200 |
|
198 | 201 |
export default AppRouter;(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/data/HostManagement.vue
+++ client/views/pages/data/HostManagement.vue
... | ... | @@ -108,7 +108,7 @@ |
108 | 108 |
<td> |
109 | 109 |
<select name="" id="host_protocol" class="full-input" v-model="hostData.host_protocol"> |
110 | 110 |
<option :value="null" disabled> 프로토콜을 선택해주세요. </option> |
111 |
- <option value="ftp">FTP - 파일 전송 프로토콜</option> |
|
111 |
+ <!-- <option value="ftp">FTP - 파일 전송 프로토콜</option> --> |
|
112 | 112 |
<option value="sftp"> SFTP - SSH 파일 전송 프로토콜 </option> |
113 | 113 |
</select> |
114 | 114 |
</td> |
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?