|
@@ -8,6 +8,7 @@ import styles from './index.less'
|
|
|
import { apiLogin } from '@/services/login'
|
|
import { apiLogin } from '@/services/login'
|
|
|
import { setAuthCache } from '@/utils/auth'
|
|
import { setAuthCache } from '@/utils/auth'
|
|
|
import { TOKEN_KEY } from '@/utils/cache/cacheEnum'
|
|
import { TOKEN_KEY } from '@/utils/cache/cacheEnum'
|
|
|
|
|
+import { DEFAULT_CACHE_TIME } from '@/settings/encryptionSetting'
|
|
|
|
|
|
|
|
const LoginMessage = ({ content }) => (
|
|
const LoginMessage = ({ content }) => (
|
|
|
<Alert
|
|
<Alert
|
|
@@ -56,7 +57,7 @@ const Login = () => {
|
|
|
// 登录
|
|
// 登录
|
|
|
const res = await apiLogin({ ...values })
|
|
const res = await apiLogin({ ...values })
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- setAuthCache(TOKEN_KEY, res.data.token)
|
|
|
|
|
|
|
+ setAuthCache(TOKEN_KEY, res.data.token, DEFAULT_CACHE_TIME)
|
|
|
|
|
|
|
|
const defaultLoginSuccessMessage = intl.formatMessage({
|
|
const defaultLoginSuccessMessage = intl.formatMessage({
|
|
|
id: 'pages.login.success',
|
|
id: 'pages.login.success',
|