Explorar o código

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

* fix(request): no use defualt showType

* user defualt error
陈帅 %!s(int64=4) %!d(string=hai) anos
pai
achega
73d493098f
Modificáronse 1 ficheiros con 14 adicións e 15 borrados
  1. 14 15
      src/app.tsx

+ 14 - 15
src/app.tsx

@@ -1,7 +1,6 @@
 import type { Settings as LayoutSettings } from '@ant-design/pro-layout';
 import type { Settings as LayoutSettings } from '@ant-design/pro-layout';
 import { PageLoading } 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 { history, Link } from 'umi';
 import RightContent from '@/components/RightContent';
 import RightContent from '@/components/RightContent';
 import Footer from '@/components/Footer';
 import Footer from '@/components/Footer';
@@ -84,21 +83,21 @@ export async function getInitialState(): Promise<{
     502: Gateway error. ',
     502: Gateway error. ',
     503: The service is unavailable. ',
     503: The service is unavailable. ',
     504: The gateway timed out. ',
     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
 // ProLayout 支持的api https://procomponents.ant.design/components/layout
 export const layout: RunTimeLayoutConfig = ({ initialState }) => {
 export const layout: RunTimeLayoutConfig = ({ initialState }) => {