putFile static method
直传文件
Implementation
static Future<Map<String,dynamic>?> putFile(String url, File file) async {
try {
assetDio();
var result = await _dio!.put(
url,
data: MultipartFile.fromFile(file.path),
);
return result.isSuccessful ? result.data : null;
} on DioException catch (e) {
return _convertException(e, url);
} on SocketException catch (e) {
return _convertException(e, url);
}
}