Browse Source

文件上传更改

ff_new
w-R 3 years ago
parent
commit
c28ea9ce55
  1. 2
      lib/community/release_dynamic.dart
  2. 7
      lib/retrofit/retrofit_api.g.dart

2
lib/community/release_dynamic.dart

@ -186,7 +186,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
} else {
thumbnail = await Thumbnails.getThumbnail(
videoFile: file.path,
imageType: ThumbFormat.WEBP,
imageType: ThumbFormat.JPEG,
quality: 10,
);
}

7
lib/retrofit/retrofit_api.g.dart

@ -23,11 +23,14 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = FormData();
String fileName = data.path.split(Platform.pathSeparator).last;
if(!fileName.contains(".jpeg"))
fileName += ".jpeg";
_data.files.add(MapEntry(
'file',
MultipartFile.fromFileSync(data.path,
filename: data.path.split(Platform.pathSeparator).last)));
print("filename:${data.path}");
filename: fileName)));
print("filename:$fileName");
if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString()));
}

Loading…
Cancel
Save