jianghaiqing 3 days ago
commit 05ae031ef6

@ -241,8 +241,8 @@ namespace DS.WMS.Core.Op.Method
}
try
{
//if (!Directory.Exists(dirAbs))
// Directory.CreateDirectory(dirAbs);
if (!Directory.Exists(dirAbs))
Directory.CreateDirectory(dirAbs);
// 先存库获取Id
var id = SnowFlakeSingle.Instance.NextId();
var fileSaveName = $"{id}{fileSuffix}".ToLower();
@ -270,17 +270,20 @@ namespace DS.WMS.Core.Op.Method
}
filesPath.Add(fileSaveName);
}
catch (UnauthorizedAccessException ex)
catch (IOException ex)
{
return await Task.FromResult(DataResult<string>.Failed("UnauthorizedAccessException "+ ex.Message));
throw new Exception("IOException " + ex.Message);
//return await Task.FromResult(DataResult<string>.Failed("IOException " + ex.Message));
}
catch (IOException ex)
catch (UnauthorizedAccessException ex)
{
return await Task.FromResult(DataResult<string>.Failed("IOException " + ex.Message));
throw new Exception("UnauthorizedAccessException " + ex.Message);
//return await Task.FromResult(DataResult<string>.Failed("UnauthorizedAccessException "+ ex.Message));
}
catch (Exception ex)
{
return await Task.FromResult(DataResult<string>.Failed("Exception " + ex.Message));
throw new Exception("Exception " + ex.Message);
//return await Task.FromResult(DataResult<string>.Failed("Exception " + ex.Message));
}
}
return await Task.FromResult(DataResult<string>.Success(string.Join(",", filesPath.ToArray())));

Loading…
Cancel
Save