Skip to content

Commit

Permalink
Merge branch 'feature/report-bug' into feature/ui-rolefunctionpreview
Browse files Browse the repository at this point in the history
  • Loading branch information
godmmt committed Oct 8, 2024
2 parents 3fed48a + b5115fe commit aba25a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iSunFA",
"version": "0.8.2+35",
"version": "0.8.2+36",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
16 changes: 12 additions & 4 deletions src/contexts/user_context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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:重新導向到選擇角色的頁面
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit aba25a3

Please sign in to comment.