Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 8fc77aab
authored
2026-04-27 10:38:40 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature-2604-cancel-upload' into feature-2604
2 parents
ce6abe0a
b86b157b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
lib/data/repositories/message/upload_start_handler.dart
lib/data/repositories/message/upload_start_handler.dart
View file @
8fc77aa
...
...
@@ -105,16 +105,22 @@ class UploadStartHandler extends MessageHandler {
}
on
ChunkSigException
{
debugPrint
(
'====================>上传失败:签名错误'
);
// 确保发送了 uploadEnd 指令
if
(!
_isCancelled
)
{
_webCubit
?.
sendUploadEnd
(
_cmdUnique
,
_cmdUploadId
,
''
,
errMsg:
'网络错误,签名失败'
);
}
}
on
ChunkUploadFailedException
{
debugPrint
(
'====================>上传失败:网络错误'
);
// 确保发送了 uploadEnd 指令
if
(!
_isCancelled
)
{
_webCubit
?.
sendUploadEnd
(
_cmdUnique
,
_cmdUploadId
,
''
,
errMsg:
'网络错误,上传失败'
);
}
}
catch
(
e
)
{
// Dio close 产生的 DioException 也会走到这里
final
msg
=
(
e
is
DioException
&&
e
.
type
==
DioExceptionType
.
cancel
)
?
'上传已取消'
:
e
.
toString
();
debugPrint
(
'====================>上传失败:
$msg
'
);
if
(!
_isCancelled
)
{
_webCubit
?.
sendUploadEnd
(
_cmdUnique
,
_cmdUploadId
,
''
,
errMsg:
msg
);
}
}
finally
{
_unfollowCubit
();
_uploadDio
?.
close
(
force:
true
);
...
...
@@ -166,7 +172,9 @@ class UploadStartHandler extends MessageHandler {
debugPrint
(
'转码进度:
$_cmdUnique
$progress
%'
);
/// 发送转码进度
if
(!
_isCancelled
)
{
_webCubit
?.
sendUploadProgress
(
_cmdUnique
,
_cmdUploadId
,
1
,
progress
,
0
,
0
,
0
,
0
);
}
},
);
}
else
{
...
...
@@ -179,7 +187,9 @@ class UploadStartHandler extends MessageHandler {
debugPrint
(
'压缩进度:
$_cmdUnique
$progress
%'
);
/// 发送压缩进度
if
(!
_isCancelled
)
{
_webCubit
?.
sendUploadProgress
(
_cmdUnique
,
_cmdUploadId
,
1
,
progress
,
0
,
0
,
0
,
0
);
}
},
);
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment