|
@@ -2,7 +2,7 @@ import { LockOutlined, UserOutlined } from '@ant-design/icons'
|
|
|
import { Alert, message, notification, Tabs } from 'antd'
|
|
import { Alert, message, notification, Tabs } from 'antd'
|
|
|
import React, { useState } from 'react'
|
|
import React, { useState } from 'react'
|
|
|
import ProForm, { ProFormCheckbox, ProFormText } from '@ant-design/pro-form'
|
|
import ProForm, { ProFormCheckbox, ProFormText } from '@ant-design/pro-form'
|
|
|
-import { useIntl, Link, history, FormattedMessage, SelectLang, useModel } from 'umi'
|
|
|
|
|
|
|
+import { useIntl, history, FormattedMessage, useModel } from 'umi'
|
|
|
|
|
|
|
|
import styles from './index.less'
|
|
import styles from './index.less'
|
|
|
import { apiLogin } from '@/services/login'
|
|
import { apiLogin } from '@/services/login'
|
|
@@ -47,12 +47,14 @@ const Login = () => {
|
|
|
if (!history) return
|
|
if (!history) return
|
|
|
const { query } = history.location
|
|
const { query } = history.location
|
|
|
const { redirect } = query
|
|
const { redirect } = query
|
|
|
- history.replace(redirect || '/')
|
|
|
|
|
- return notification.success({
|
|
|
|
|
|
|
+ // 清除所有notification
|
|
|
|
|
+ notification.destroy()
|
|
|
|
|
+ notification.success({
|
|
|
message: intl.formatMessage({ id: 'pages.login.success.title' }),
|
|
message: intl.formatMessage({ id: 'pages.login.success.title' }),
|
|
|
description: redirect && `${intl.formatMessage({ id: 'pages.login.success.desc' })}: ${username}`,
|
|
description: redirect && `${intl.formatMessage({ id: 'pages.login.success.desc' })}: ${username}`,
|
|
|
duration: 3
|
|
duration: 3
|
|
|
})
|
|
})
|
|
|
|
|
+ return history.replace(redirect || '/')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleSubmit = async values => {
|
|
const handleSubmit = async values => {
|