Browse Source

登录之后去首页

master
nili 6 months ago
parent
commit
2bb8770523
  1. 2
      dist/index.html
  2. 1
      dist/p__User__Login__index.039826c8.async.js
  3. 1
      dist/p__User__Login__index.b7ec804e.async.js
  4. 2
      dist/umi.ce1a56e3.js
  5. 9
      src/pages/User/Login/index.tsx

2
dist/index.html

@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script src="/umi.5db2908f.js"></script>
<script src="/umi.ce1a56e3.js"></script>
</body></html>

1
dist/p__User__Login__index.039826c8.async.js

File diff suppressed because one or more lines are too long

1
dist/p__User__Login__index.b7ec804e.async.js

File diff suppressed because one or more lines are too long

2
dist/umi.5db2908f.js → dist/umi.ce1a56e3.js

File diff suppressed because one or more lines are too long

9
src/pages/User/Login/index.tsx

@ -2,8 +2,8 @@ import { Footer } from '@/components';
import { adminLogin as login } from '@/services/matrix/admin';
import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { LoginForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components';
import { FormattedMessage, Helmet, history, SelectLang, useIntl, useModel } from '@umijs/max';
import { message, Tabs } from 'antd';
import { FormattedMessage, Helmet, SelectLang, history, useIntl, useModel } from '@umijs/max';
import { Tabs, message } from 'antd';
import { createStyles } from 'antd-style';
import React, { useState } from 'react';
import { flushSync } from 'react-dom';
@ -86,8 +86,9 @@ const Login: React.FC = () => {
});
message.success(defaultLoginSuccessMessage);
await fetchUserInfo();
const urlParams = new URL(window.location.href).searchParams;
history.push(urlParams.get('redirect') || '/');
// const urlParams = new URL(window.location.href).searchParams;
// history.push(urlParams.get('redirect') || '/');
history.push('/');
// 如果失败去设置用户错误信息
// setUserLoginState(msg);
} catch (error) {

Loading…
Cancel
Save