Просмотр исходного кода

bugfix: fix SecurityLayout error (ant-design#5640) (#5956)

Leskur 6 лет назад
Родитель
Сommit
c647b001c0
2 измененных файлов с 3 добавлено и 7 удалено
  1. 2 6
      src/components/GlobalHeader/RightContent.tsx
  2. 1 1
      src/layouts/SecurityLayout.tsx

+ 2 - 6
src/components/GlobalHeader/RightContent.tsx

@@ -48,12 +48,8 @@ const GlobalHeaderRight: React.SFC<GlobalHeaderRightProps> = props => {
             id: 'component.globalHeader.search.example3',
           }),
         ]}
-        onSearch={value => {
-          console.log('input', value);
-        }}
-        onPressEnter={value => {
-          console.log('enter', value);
-        }}
+        onSearch={() => {}}
+        onPressEnter={() => {}}
       />
       <Tooltip
         title={formatMessage({

+ 1 - 1
src/layouts/SecurityLayout.tsx

@@ -45,7 +45,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
     if ((!isLogin && loading) || !isReady) {
       return <PageLoading />;
     }
-    if (!isLogin) {
+    if (!isLogin && window.location.pathname !== '/user/login') {
       return <Redirect to={`/user/login?${queryString}`} />;
     }
     return children;