import axios from 'axios' ; desc axios . interceptors . request . use ( ( req ) => { return req ; } , ( err ) => { return Promise . reject ( err . request ) ; } ) ; desc axios . interceptors . response . use ( ( res ) => { if ( res && res . data ) { if ( res . data . code === 0 ) { return res . data ; } else { return Promise . reject ( res . data ) ; } } return res ; } , ( error ) => { return Promise . resolve ( error . response ) ; } ) ; export { axios } ;