Browse Source

fix(request): no use defualt showType (#8790)

* fix(request): no use defualt showType

* user defualt error
pull/8866/head
陈帅 5 years ago
committed by GitHub
parent
commit
73d493098f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      src/app.tsx

29
src/app.tsx

@ -1,7 +1,6 @@
import type { Settings as LayoutSettings } from '@ant-design/pro-layout';
import { PageLoading } from '@ant-design/pro-layout';
import { notification } from 'antd';
import type { RequestConfig, RunTimeLayoutConfig } from 'umi';
import type { RunTimeLayoutConfig } from 'umi';
import { history, Link } from 'umi';
import RightContent from '@/components/RightContent';
import Footer from '@/components/Footer';
@ -84,21 +83,21 @@ export async function getInitialState(): Promise<{
502: Gateway error. ',
503: The service is unavailable. ',
504: The gateway timed out. ',
* @see https://beta-pro.ant.design/docs/request-cn
* @see https://pro.ant.design/docs/request/
*/
export const request: RequestConfig = {
errorHandler: (error: any) => {
const { response } = error;
// export const request: RequestConfig = {
// errorHandler: (error: any) => {
// const { response } = error;
if (!response) {
notification.error({
description: '您的网络发生异常,无法连接服务器',
message: '网络异常',
});
}
throw error;
},
};
// if (!response) {
// notification.error({
// description: '您的网络发生异常,无法连接服务器',
// message: '网络异常',
// });
// }
// throw error;
// },
// };
// ProLayout 支持的api https://procomponents.ant.design/components/layout
export const layout: RunTimeLayoutConfig = ({ initialState }) => {

Loading…
Cancel
Save