|
@@ -7,6 +7,7 @@ import type { RequestOptionsInit, ResponseError } from 'umi-request'
|
|
|
import RightContent from '@/components/RightContent'
|
|
|
// import { currentUser as queryCurrentUser } from './services/ant-design-pro/api'
|
|
|
import consts from './utils/consts'
|
|
|
+import { queryCurrentUser } from './services/api/login'
|
|
|
|
|
|
const loginPath = '/user/login'
|
|
|
|
|
@@ -28,7 +29,7 @@ export async function getInitialState(): Promise<{
|
|
|
const msg = await queryCurrentUser()
|
|
|
return msg.data
|
|
|
} catch (error) {
|
|
|
- // history.push(loginPath)
|
|
|
+ history.push(loginPath)
|
|
|
}
|
|
|
return undefined
|
|
|
}
|
|
@@ -37,7 +38,7 @@ export async function getInitialState(): Promise<{
|
|
|
const currentUser = await fetchUserInfo()
|
|
|
return {
|
|
|
fetchUserInfo,
|
|
|
- currentUser,
|
|
|
+ ...currentUser,
|
|
|
settings: {}
|
|
|
}
|
|
|
}
|