Skip to content

Commit

Permalink
修复ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzqs committed Jan 6, 2025
1 parent 0385c4f commit 2b99778
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 5 additions & 5 deletions base/lib/src/auth/put_policy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class PutPolicy {
/// 指定上传的目标资源空间 Bucket 和资源键 Key(最大为 750 字节)。
///
/// 有三种格式:
/// <Bucket> 表示允许用户上传文件到指定的 Bucket,在这种格式下文件只能新增。
/// <Bucket>:<Key> 表示只允许用户上传指定 Key 的文件。在这种格式下文件默认允许修改。
/// <Bucket>:<KeyPrefix> 表示只允许用户上传指定以 KeyPrefix 为前缀的文件。
/// \<Bucket\> 表示允许用户上传文件到指定的 Bucket,在这种格式下文件只能新增。
/// \<Bucket\>:\<Key\> 表示只允许用户上传指定 Key 的文件。在这种格式下文件默认允许修改。
/// \<Bucket\>:\<KeyPrefix\> 表示只允许用户上传指定以 KeyPrefix 为前缀的文件。
/// 具体信息一定请查看上述的上传策略文档!
final String scope;

Expand Down Expand Up @@ -40,8 +40,8 @@ class PutPolicy {

/// Web 端文件上传成功后,浏览器执行 303 跳转的 URL。
///
/// 文件上传成功后会跳转到 <[returnUrl]>?upload_ret=<QueryString>
/// 其中 <QueryString> 包含 [returnBody] 内容。
/// 文件上传成功后会跳转到 \<[returnUrl]\>?upload_ret=\<QueryString\>
/// 其中 \<QueryString\> 包含 [returnBody] 内容。
/// 如不设置 [returnUrl],则直接将 [returnBody] 的内容返回给客户端。
final String? returnUrl;

Expand Down
12 changes: 8 additions & 4 deletions flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,14 @@ class BaseState extends State<Base> with DisposableState {
}

void onSelectedFile(PlatformFile file) {
printToConsole(
'选中文件: path: ${file.path}, filename: ${file.name}, size: ${file.size}');
// ignore: unnecessary_null_comparison
if (file.size != null) {
if (kIsWeb) {
printToConsole('选中文件: filename: ${file.name}, size: ${file.size}');
} else {
printToConsole(
'选中文件: path: ${file.path}, filename: ${file.name}, size: ${file.size}');
}

if (file.size != 0) {
// 一般在非 web 平台上可以直接读取 size 属性
printToConsole('文件尺寸:${humanizeFileSize(file.size.toDouble())}');
} else if (file.bytes != null) {
Expand Down

0 comments on commit 2b99778

Please sign in to comment.