Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
base_data_channel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PublicSource
base_data_channel
Commits
0a2178ca
Commit
0a2178ca
authored
Feb 17, 2025
by
tongzifang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add curl_logger_dio_interceptor
parent
74b1a7b9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
pubspec.lock
example/pubspec.lock
+27
-3
basedio.dart
lib/http/basedio.dart
+2
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
example/pubspec.lock
View file @
0a2178ca
...
...
@@ -128,14 +128,30 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
curl_logger_dio_interceptor:
dependency: transitive
description:
name: curl_logger_dio_interceptor
sha256: f20d89187a321d2150e1412bca30ebf4d89130bafc648ce21bd4f1ef4062b214
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
dio:
dependency: transitive
description:
name: dio
sha256: "0894a098594263fe1caaba3520e3016d8a855caeb010a882273189cca10f11e9"
sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9"
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.8.0+1"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: e485c7a39ff2b384fa1d7e09b4e25f755804de8384358049124830b04fc4f93a
url: "https://pub.flutter-io.cn"
source: hosted
version: "
5.1.1
"
version: "
2.1.0
"
dotted_border:
dependency: transitive
description:
...
...
@@ -749,6 +765,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
web:
dependency: transitive
description:
name: web
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
win32:
dependency: transitive
description:
...
...
@@ -774,5 +798,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=3.
3
.0 <4.0.0"
dart: ">=3.
4
.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
lib/http/basedio.dart
View file @
0a2178ca
import
'dart:io'
;
import
'package:base_data_channel/http/qmai_host.dart'
;
import
'package:curl_logger_dio_interceptor/curl_logger_dio_interceptor.dart'
;
import
'package:dio/dio.dart'
;
import
'package:dio/io.dart'
;
import
'package:http_proxy/http_proxy.dart'
;
...
...
@@ -30,6 +31,7 @@ class BaseDio {
baseUrl:
QmaiHost
.
getBaseUrl
());
// 设置超时时间等 ...
dio
.
interceptors
.
add
(
HeaderInterceptor
());
// 添加拦截器,如 token之类,需要全局使用的参数
dio
.
interceptors
.
add
(
ApprovalInterceptor
());
dio
.
interceptors
.
add
(
CurlLoggerDioInterceptor
(
printOnSuccess:
true
));
if
(
SpUtil
.
getString
(
'build_type'
)
!=
'release'
)
{
dio
.
interceptors
.
add
(
PrettyDioLogger
(
// 添加日志格式化工具类
...
...
pubspec.yaml
View file @
0a2178ca
...
...
@@ -53,6 +53,7 @@ dependencies:
keyboard_dismisser
:
^3.0.0
insta_image_viewer
:
^1.0.2
pull_to_refresh_flutter3
:
^2.0.1
curl_logger_dio_interceptor
:
^1.0.0
# sentry_flutter: ^7.4.2
flutter_boost
:
git
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment