123456789101112131415161718192021222324252627282930 |
- import 'dart:async';
- import 'package:get/get.dart';
- import 'package:get/get_connect/http/src/request/request.dart';
- //获取到相应的响应拦截
- FutureOr<dynamic> responseInterceptor(Request request, Response response) async {
- if (response.statusCode != 200) {
- handleErrorStatus(response);
- return;
- }
- return response;
- }
- void handleErrorStatus(Response response) {
- switch (response.statusCode) {
- case 400:
- break;
- default:
- }
- return;
- }
|