李志伟 3 gadus atpakaļ
vecāks
revīzija
17f3142fd9
2 mainītis faili ar 13 papildinājumiem un 3 dzēšanām
  1. 6
    2
      src/app.jsx
  2. 7
    1
      src/components/RightContent/AvatarDropdown.jsx

+ 6
- 2
src/app.jsx Parādīt failu

19
   const fetchUserInfo = async () => {
19
   const fetchUserInfo = async () => {
20
     try {
20
     try {
21
       return await queryCurrentUser();
21
       return await queryCurrentUser();
22
-    } catch (error) {
23
-      history.push(loginPath);
22
+    } catch (error) {      
23
+      if (history.location.pathname == '/user/orgLogin') {
24
+        history.push('/user/orgLogin')
25
+      }else{
26
+        history.push(loginPath);
27
+      }
24
     }
28
     }
25
 
29
 
26
     return undefined;
30
     return undefined;

+ 7
- 1
src/components/RightContent/AvatarDropdown.jsx Parādīt failu

17
   if (window.location.pathname !== '/user/login' && !redirect) {
17
   if (window.location.pathname !== '/user/login' && !redirect) {
18
     if (val == 'org') {
18
     if (val == 'org') {
19
       history.replace({
19
       history.replace({
20
-        pathname: '/user/orgLogin',        
20
+        pathname: '/user/orgLogin',
21
+        search: stringify({
22
+          redirect: pathname,
23
+        }),      
21
       });
24
       });
22
     } else {
25
     } else {
23
       history.replace({
26
       history.replace({
24
         pathname: '/user/login',
27
         pathname: '/user/login',
28
+        search: stringify({
29
+          redirect: pathname,
30
+        }),
25
       });
31
       });
26
     }
32
     }
27
   }
33
   }