refactor(TradeOAService): 简化文件流处理逻辑
移除不必要的 using 语句块,直接使用 FileStream 对象
This commit is contained in:
@@ -137,11 +137,9 @@ namespace YLErp.Modules.TradeModule
|
||||
using (var form = new MultipartFormDataContent())
|
||||
{
|
||||
// 添加文件
|
||||
using (var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
var fileName = Path.GetFileName(filePath);
|
||||
form.Add(new StreamContent(fileStream), "file", fileName);
|
||||
}
|
||||
var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
|
||||
var fileName = Path.GetFileName(filePath);
|
||||
form.Add(new StreamContent(fileStream), "file", fileName);
|
||||
|
||||
// 添加systemToken
|
||||
form.Add(new StringContent(systemToken), "systemToken");
|
||||
|
||||
Reference in New Issue
Block a user