import request from './request/responseInterceptor' ; import { RequestOptionsInit } from 'umi-request' ; import { message } from 'antd' ; function createService ( action , method ) { return ( params = { } ) => { const config = { method } ; if ( method === 'get' ) { config . params = params ; } else { config . data = params ; } return request ( action , config ) . catch ( ( e ) => { message . error ( e ) ; } ) ; } ; } export default createService ;