import { notification } from 'antd' ; import axios , { AxiosResponse } from 'axios' ; class NetUtils { public static get ( url , call ) { axios . get ( url ) . then ( ( response ) => { call ( response . data ) ; } ) . catch ( ( ) => { notification . error ( { message : '请求失败' , description : '请重试，多次重试后仍然失败，请联系管理员。' , placement : "bottomRight" } ) ; } ) ; } public static post ( url , form , call ) { axios . post ( url , form ) . then ( ( response ) => { call ( response . data ) ; } ) . catch ( ( ) => { notification . error ( { message : '请求失败' , description : '请重试，多次重试后仍然失败，请联系管理员。' , placement : "bottomRight" } ) ; } ) ; } } export default NetUtils ;