Skip to content

Commit

Permalink
Merge pull request #156 from PLADI-ALM/feat/PDW-76-car-booking
Browse files Browse the repository at this point in the history
[PDW-76/fix] 로그아웃 수정
  • Loading branch information
psyeon1120 authored Dec 5, 2023
2 parents a1dde94 + e8817b8 commit 82f9d72
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pages/admin/office/OfficeManageAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function OfficeManageAdd(props) {
}
}, [])

// 책임자 리스트 검색
// 시설 리스트 검색
const getFacilityList = () => {
AdminOfficesAxios.get(`facilities?name=${searchWord}`, {
headers: {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/basic/booking/office/SelectOffice.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function SelectOffice(props) {
const searchOffice = () => {
let url = `?facilityName=${facilityName.current}`
if (date !== "")
url = `?facilityName=${facilityName.current}&date=${date}&startTime=${startTime}&endTime=${endTime}`
url = `?facilityName=${facilityName.current}&date=${date}&startTime=${startTime}&endTime=${endTime}&size=200`
OfficesAxios.get(url, {
headers: {
Authorization: getToken()
Expand Down
2 changes: 2 additions & 0 deletions src/utils/CookiesUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ export const removeAllCookies = () => {
Object.keys(cookieKeys).forEach(key => {
cookies.remove(key)
})

window.location.replace('/')
}
7 changes: 3 additions & 4 deletions src/utils/ErrorHandlerUtil.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { removeTokenAndNavigate, isLogin } from "utils/IsLoginUtil"
import {removeAllCookies} from "./CookiesUtil";

// 일반 예외처리
export function basicError(error) {
Expand All @@ -12,8 +13,7 @@ export function basicError(error) {

// 토큰에러인 경우 쿠키 삭제 (토큰 에러를 두번 alert 하지 않기 위해 토큰 존재 여부 판단)
if (String(error.response.data.code).startsWith('T')) {
alert(errMsg)
removeTokenAndNavigate()
removeAllCookies()
}
} else {
console.log(error)
Expand All @@ -37,8 +37,7 @@ export function notLogInError(error) {

// 토큰에러인 경우 쿠키 삭제 (토큰 에러를 두번 alert 하지 않기 위해 토큰 존재 여부 판단)
if (String(error.response.data.code).startsWith('T') && isLogin()) {
alert(errMsg)
removeTokenAndNavigate()
removeAllCookies()
}
} else {
console.log(error)
Expand Down

0 comments on commit 82f9d72

Please sign in to comment.