李志伟 hace 3 años
padre
commit
17f3142fd9
Se han modificado 2 ficheros con 13 adiciones y 3 borrados
  1. 6
    2
      src/app.jsx
  2. 7
    1
      src/components/RightContent/AvatarDropdown.jsx

+ 6
- 2
src/app.jsx Ver fichero

@@ -19,8 +19,12 @@ export async function getInitialState() {
19 19
   const fetchUserInfo = async () => {
20 20
     try {
21 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 30
     return undefined;

+ 7
- 1
src/components/RightContent/AvatarDropdown.jsx Ver fichero

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