| | |
| | | * @doc https://umijs.org/docs/max/request#配置 |
| | | */ |
| | | export const errorConfig: RequestConfig = { |
| | | baseURL: BASE_URL, |
| | | // baseURL: BASE_URL, |
| | | |
| | | // 请求拦截器 |
| | | requestInterceptors: [ |
| | |
| | | |
| | | o.headers = { |
| | | ...config.headers, |
| | | Authorization, |
| | | Authorization:'Bearer ' + Authorization, |
| | | } |
| | | // } |
| | | // 拦截请求配置,进行个性化处理。 |
| | |
| | | const { data } = response as unknown as ResponseStructure; |
| | | if (data?.code === 103 || data?.code === 401) { |
| | | localStorage.clear() |
| | | // history.replace('/login') |
| | | history.replace('/login') |
| | | return Promise.resolve(response) |
| | | } |
| | | if (data?.code != 200) { |