Skip to content

Commit

Permalink
Merge pull request #205 from readyvery/test
Browse files Browse the repository at this point in the history
Fix: 로그아웃 후 경로 수정
  • Loading branch information
hhbb0081 authored Mar 27, 2024
2 parents ce15d3d + ec9d9ad commit 49c2c80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
13 changes: 3 additions & 10 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/components/views/Home/ReciptBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ export default function ReceiptBox ({children, modalIdx, setModalIdx}) {
<div className="receiptTextBox">
<span className="receipt-text">할인금액</span>
<span className="receipt-text">
{selectedInfo[0]?.couponUsed ? "(-) 500원" : "0원"}
{/* {selectedInfo[0]?.couponUsed ? "(-) 500원" : "0원"} */}
{(selectedInfo[0]?.price - selectedInfo[0]?.salePrice).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
</span>
</div>
<div className="receiptTextBox">
<span className="receipt-text bold">총 결제금액</span>
<span className="receipt-text bold red">
{selectedInfo[0]?.price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
{selectedInfo[0]?.salePrice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
</span>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/Mypage/useMypageLogout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ const useMypageLogout = () => {
};
try {
const response = await axios.get(apiUrl, config);
if(response.status === 200){
if(response.status === 200 && response.data.success){
console.log(response);
setIsAuthenticated(false);
localStorage.clear();
removeCookie("JSESSIONID");
removeCookie("accessToken");
removeCookie("refreshToken");
message.success("로그아웃에 성공하셨습니다.");
navigate("/login");
}
navigate("/");
} catch (error) {
message.info("관리자에게 문의하세요.");
// navigate("/");
Expand Down

0 comments on commit 49c2c80

Please sign in to comment.