|
@@ -1,4 +1,5 @@
|
|
|
import type { Settings as LayoutSettings } from '@ant-design/pro-layout'
|
|
|
+import { notification } from 'antd'
|
|
|
import { PageLoading } from '@ant-design/pro-layout'
|
|
|
import type { RequestConfig, RunTimeLayoutConfig } from 'umi'
|
|
|
import { getIntl, getLocale, history } from 'umi'
|
|
@@ -50,7 +51,7 @@ const authHeaderInterceptor = (url: string, options: RequestOptionsInit) => {
|
|
|
const token = window.localStorage.getItem('TOKEN_ID')
|
|
|
// 如果是登录页面,不执行
|
|
|
if (!token && history.location.pathname !== loginPath) {
|
|
|
- // return history.push(loginPath)
|
|
|
+ return history.push(loginPath)
|
|
|
}
|
|
|
const authHeader = { Authorization: `Bearer ${JSON.parse(token)}` }
|
|
|
return {
|
|
@@ -159,8 +160,8 @@ export const request: RequestConfig = {
|
|
|
}
|
|
|
return response
|
|
|
}
|
|
|
- ],
|
|
|
- requestInterceptors: [authHeaderInterceptor]
|
|
|
+ ]
|
|
|
+ // requestInterceptors: [authHeaderInterceptor]
|
|
|
}
|
|
|
|
|
|
// ProLayout 支持的api https://procomponents.ant.design/components/layout
|