1.打开src根目录下的app.jsx
2.按照官网的说法进行request请求拦截配置,即在app.jsx中进行配置
3.app.jsx中引入src/utils/request.js
import { requestInterceptors, responseInterceptors, errorHandler } from '@/utils/Request';
4.在function getInitialState方法结尾后加入以下代码
export const request = {
errorHandler,
requestInterceptors: [requestInterceptors],
responseInterceptors: [responseInterceptors],
};