|
|
@@ -5,7 +5,7 @@ import { apiLogin } from '@/services/login'
|
|
|
import { getPageQuery } from '@/utils/utils'
|
|
|
import { message } from 'antd'
|
|
|
import consts from '@/consts'
|
|
|
-import { saveTokenId } from '@/basic/utils/common'
|
|
|
+import { removeTokenId, saveTokenId } from '@/basic/utils/common'
|
|
|
|
|
|
const Model = {
|
|
|
namespace: 'login',
|
|
|
@@ -24,6 +24,7 @@ const Model = {
|
|
|
|
|
|
if (response && response.code === consts.RET_CODE.SUCCESS) {
|
|
|
saveTokenId(response.data.token)
|
|
|
+ yield put({ type: 'user/fetchCurrent' })
|
|
|
const urlParams = new URL(window.location.href)
|
|
|
const params = getPageQuery()
|
|
|
message.success('🎉 🎉 🎉 登录成功')
|
|
|
@@ -51,6 +52,7 @@ const Model = {
|
|
|
const { redirect } = getPageQuery() // Note: There may be security issues, please note
|
|
|
|
|
|
if (window.location.pathname !== '/user/login' && !redirect) {
|
|
|
+ removeTokenId()
|
|
|
history.replace({
|
|
|
pathname: '/user/login',
|
|
|
search: stringify({
|