import ErrorRetryMiddleware from '@prequest/error-retry' ; import { Request , Response } from '@prequest/miniprogram' ; export const errorRetryMiddleware = ErrorRetryMiddleware < Request , Response > ( { retryCount : 2 , retryControl ( opt , e ) { const { method , path } = opt ; if ( e . errMsg === 'request:fail abort' ) return false ; if ( path === '/api' ) return false ; return method === 'GET' || ! method ; } , } ) ;