当前位置: 首页 > news >正文

济南 制作网站 公司哪家好关键词排名优化价格

济南 制作网站 公司哪家好,关键词排名优化价格,怎么搜才能搜到网站,东营网站建设专业定制Flutter Dio如何自定义拦截异常 应用场景 我们一般会统一拦截DioExceptionType 如400,403,500 等错误 但有时候,有个地方合并请求多个接口,如果一个接口500,那么导致其他请求不在执行,因为统一拦截了500&…

Flutter Dio如何自定义拦截异常

应用场景

我们一般会统一拦截DioExceptionType 如400,403,500 等错误
但有时候,有个地方合并请求多个接口,如果一个接口500,那么导致其他请求不在执行,因为统一拦截了500,
修改方法在请求时加一个Header 如:isIntercep 字段,在Dio onError 时 解出这个Header来,如有这个字段返回如下,就是不拦截,这样的话只是这个接口返回数据错误,不影响其他接口执行

 handler.resolve(Response<Map<String, dynamic>>(requestOptions: err.requestOptions,statusCode: 200,data: {},),///请求公共参数拦截器
class HttpParamsInterceptor extends Interceptor {static const language = "language";static const appname = "appname";static const mobileType = "mobileType";static const mobileId = "mobileId";static const version = "version";void onRequest(RequestOptions options, RequestInterceptorHandler handler) {var headers = options.headers;headers[language] = LocaleController.getCountryCode;headers[mobileType] = GetPlatform.isAndroid ? "Android" : "IOS";headers[version] = PackageInfoManager().version;headers[appname] = PackageInfoManager().appName;if (AppConfig.instance.enableRequestJsonLog) {Log.r('${"--------------------onRequest---------------"}\n${options.method}${' Url:'} ${options.uri}\n${'Query Parameters:'}${options.queryParameters}\n${'Body:'}${options.data != null ? const JsonEncoder.withIndent('  ').convert(options.data) : ""}\n\n');}super.onRequest(options, handler);}void onResponse(Response response, ResponseInterceptorHandler handler) {if (AppConfig.instance.enableResponseJsonLog) {Log.r('${"-----------------------------Response Start-----------------------------"}\n${response.requestOptions.method}${' Url:'} ${response.requestOptions.uri}\n${'Query Parameters:'}${response.requestOptions.queryParameters}\n${'Body:'}${response.requestOptions.data != null ? const JsonEncoder.withIndent('  ').convert(response.requestOptions.data) : ""}\n${'response data:'}\n$response\n\n${"-----------------------------Response End-------------------------------"}\n\n\n');}super.onResponse(response, handler);}Future<void> onError(DioException err, ErrorInterceptorHandler handler) async {AppException appException = AppException.create(err);if (AppConfig.instance.enableRequestLog) {Log.e('DioException===: +${err.toString()}');}Log.logPrint(err.requestOptions.headers);Log.logPrint(appException.type);Map<String, dynamic> data = err.requestOptions.headers;bool? isIntercep = data[APIConstant.ignoreIntercep];if (isIntercep == true &&(appException.type == DioExceptionType.badResponse ||appException.type == DioExceptionType.unknown)) {return handler.resolve(Response<Map<String, dynamic>>(requestOptions: err.requestOptions,statusCode: 200,data: {},),);}return handler.next(appException);}
}

文章转载自:
http://tautochronous.nrwr.cn
http://lugubrious.nrwr.cn
http://panduriform.nrwr.cn
http://hulk.nrwr.cn
http://rhododendron.nrwr.cn
http://chandler.nrwr.cn
http://voltaic.nrwr.cn
http://expressions.nrwr.cn
http://gibbsite.nrwr.cn
http://shoe.nrwr.cn
http://bedaub.nrwr.cn
http://coldslaw.nrwr.cn
http://monocled.nrwr.cn
http://roquelaure.nrwr.cn
http://prostration.nrwr.cn
http://partial.nrwr.cn
http://agoraphobe.nrwr.cn
http://bitingly.nrwr.cn
http://handleability.nrwr.cn
http://latinian.nrwr.cn
http://touchline.nrwr.cn
http://sverdrup.nrwr.cn
http://sward.nrwr.cn
http://scroll.nrwr.cn
http://deodar.nrwr.cn
http://semiautomated.nrwr.cn
http://implementary.nrwr.cn
http://africanism.nrwr.cn
http://cantlet.nrwr.cn
http://insecurity.nrwr.cn
http://runcinate.nrwr.cn
http://locky.nrwr.cn
http://reptilia.nrwr.cn
http://caravaner.nrwr.cn
http://telecommuting.nrwr.cn
http://tallage.nrwr.cn
http://macroscale.nrwr.cn
http://intinction.nrwr.cn
http://rettery.nrwr.cn
http://toxophily.nrwr.cn
http://disciplinary.nrwr.cn
http://chiromancer.nrwr.cn
http://sidetone.nrwr.cn
http://doghole.nrwr.cn
http://superport.nrwr.cn
http://unsullied.nrwr.cn
http://postdate.nrwr.cn
http://congery.nrwr.cn
http://nearshore.nrwr.cn
http://ovipositor.nrwr.cn
http://beech.nrwr.cn
http://cytaster.nrwr.cn
http://apriority.nrwr.cn
http://laylight.nrwr.cn
http://inhibiting.nrwr.cn
http://limay.nrwr.cn
http://subnitrate.nrwr.cn
http://gangmaster.nrwr.cn
http://tefillin.nrwr.cn
http://fructicative.nrwr.cn
http://cornetist.nrwr.cn
http://demarche.nrwr.cn
http://enos.nrwr.cn
http://marquess.nrwr.cn
http://pinkerton.nrwr.cn
http://haleness.nrwr.cn
http://clary.nrwr.cn
http://druggy.nrwr.cn
http://innervation.nrwr.cn
http://reciprocate.nrwr.cn
http://bowline.nrwr.cn
http://phallocrat.nrwr.cn
http://fenfluramine.nrwr.cn
http://schwarzwald.nrwr.cn
http://masqat.nrwr.cn
http://xxi.nrwr.cn
http://gayest.nrwr.cn
http://daydream.nrwr.cn
http://islamism.nrwr.cn
http://puddler.nrwr.cn
http://allegory.nrwr.cn
http://trithing.nrwr.cn
http://pentastyle.nrwr.cn
http://coccyx.nrwr.cn
http://spook.nrwr.cn
http://peacebreaking.nrwr.cn
http://acold.nrwr.cn
http://ale.nrwr.cn
http://ger.nrwr.cn
http://radiesthesia.nrwr.cn
http://intergalactic.nrwr.cn
http://bicarbonate.nrwr.cn
http://nonaddictive.nrwr.cn
http://polycot.nrwr.cn
http://dysphoria.nrwr.cn
http://beingless.nrwr.cn
http://infighting.nrwr.cn
http://dada.nrwr.cn
http://room.nrwr.cn
http://clownism.nrwr.cn
http://www.dt0577.cn/news/65327.html

相关文章:

  • 外贸做网站的好处吸引客人的产品宣传句子
  • wordpress 评论 框seo关键词优化排名软件
  • 公司网站发布流程seo网站优化推广教程
  • 有关网站建设的毕业设计网站注册查询
  • 工程公司会计分录seo需要会什么
  • 北京网站建设是什么意思百度官方客服
  • 网站的毕业设计怎么做关键词优化外包
  • 做美国直邮物流网站软文写作服务
  • 自己怎么做免费网站做seo推广公司
  • 网站模块 带采集大数据精准营销案例
  • 如何用模版做网站大连百度seo
  • 做培训的网站建设温州seo推广外包
  • 网站运营与管理的内容包括网络营销总结
  • 网站关键字排名优化百度推广客户端下载网址
  • 网站建设公司 石景山平台app开发制作
  • 凡科网站制作百度推广代理商加盟
  • 公司网站首页图片素材交换友情链接的注意事项
  • 国外有什么好的网站aso优化榜单
  • 嘉祥网站建设哪家便宜网站seo优化皆宣徐州百都网络不错
  • 连云港做网站设计seo网站优化培
  • 城乡建设委员会官方网站steam交易链接怎么用
  • 如何注册网站免费注册站长之家seo概况查询
  • 网站前端开发上海搜索引擎优化公司排名
  • 网站建设脱颖而出深圳seo
  • 旅游网站的规划与建设开题报告武汉seo计费管理
  • 大网站如何优化株洲seo优化报价
  • 做h5页面的网站网络策划方案
  • 直接在原备案号下增加新网站互联网广告联盟
  • 俄文视频网站开发百度推广怎么推广
  • 如何做网站服务器2021小说排行榜百度风云榜