12345678910111213141516171819 |
- import 'package:domain/constants/api_constants.dart';
- import 'package:flutter_riverpod/flutter_riverpod.dart';
- import 'package:riverpod_annotation/riverpod_annotation.dart';
- import 'package:plugin_platform/http/dio_engine.dart';
- import '../../dio_interceptors/interceptor_auth_dio.dart';
- import '../../dio_interceptors/interceptor_status_code_dio.dart';
- part 'http_provider.g.dart';
- @Riverpod(keepAlive: true)
- DioEngine dioEngine(Ref ref) {
- return DioEngine(
- ApiConstants.baseUrl,
- interceptors: [StatusCodeDioInterceptors(), AuthDioInterceptors()], //需要加上与App关联的一些拦截处理
- );
- }
|