Browse Source

登录之后去首页

master
nili 9 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> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.5db2908f.js"></script> <script src="/umi.ce1a56e3.js"></script>
</body></html> </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 { adminLogin as login } from '@/services/matrix/admin';
import { LockOutlined, UserOutlined } from '@ant-design/icons'; import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { LoginForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components'; import { LoginForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components';
import { FormattedMessage, Helmet, history, SelectLang, useIntl, useModel } from '@umijs/max'; import { FormattedMessage, Helmet, SelectLang, history, useIntl, useModel } from '@umijs/max';
import { message, Tabs } from 'antd'; import { Tabs, message } from 'antd';
import { createStyles } from 'antd-style'; import { createStyles } from 'antd-style';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { flushSync } from 'react-dom'; import { flushSync } from 'react-dom';
@ -86,8 +86,9 @@ const Login: React.FC = () => {
}); });
message.success(defaultLoginSuccessMessage); message.success(defaultLoginSuccessMessage);
await fetchUserInfo(); await fetchUserInfo();
const urlParams = new URL(window.location.href).searchParams; // const urlParams = new URL(window.location.href).searchParams;
history.push(urlParams.get('redirect') || '/'); // history.push(urlParams.get('redirect') || '/');
history.push('/');
// 如果失败去设置用户错误信息 // 如果失败去设置用户错误信息
// setUserLoginState(msg); // setUserLoginState(msg);
} catch (error) { } catch (error) {

Loading…
Cancel
Save