diff --git a/package.json b/package.json index c08ce1cb9..af633640f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iSunFA", - "version": "0.8.2+35", + "version": "0.8.2+36", "private": false, "scripts": { "dev": "next dev", diff --git a/src/contexts/user_context.tsx b/src/contexts/user_context.tsx index 6c5ec2d76..d57ddba21 100644 --- a/src/contexts/user_context.tsx +++ b/src/contexts/user_context.tsx @@ -128,15 +128,15 @@ export const UserProvider = ({ children }: { children: React.ReactNode }) => { // Info: (20240530 - Shirley) 在瀏覽器被重新整理後,如果沒有登入,就 redirect to login page const redirectToLoginPage = () => { if (router.pathname.startsWith('/users') && !router.pathname.includes(ISUNFA_ROUTE.LOGIN)) { - // Info: (20241008 - Liz) 將當前路徑存入 localStorage,以便登入後重新導向 - const currentPath = router.asPath; - localStorage.setItem('redirectPath', currentPath); + // Deprecated: (20241008 - Liz) + // eslint-disable-next-line no-console + console.log('呼叫 redirectToLoginPage 並且重新導向到登入頁面'); router.push(ISUNFA_ROUTE.LOGIN); } // Deprecated: (20241001 - Liz) // eslint-disable-next-line no-console - console.log('呼叫 redirectToLoginPage'); + console.log('呼叫 redirectToLoginPage (但不一定真的重新導向喔)'); }; // Info: (20241001 - Liz) Alpha:重新導向到選擇公司的頁面 ; Beta:重新導向到選擇角色的頁面 @@ -369,6 +369,14 @@ export const UserProvider = ({ children }: { children: React.ReactNode }) => { setIsAuthLoading(true); + // Info: (20241008 - Liz) 將當前路徑存入 localStorage,以便登入後可以重新導向回原本的路徑 + const currentPath = router.asPath; + localStorage.setItem('redirectPath', currentPath); + + // Deprecated: (20241008 - Liz) + // eslint-disable-next-line no-console + console.log('儲存現在路由 currentPath:', currentPath); + const { data: StatusInfo, success: getStatusInfoSuccess,