|
|
@ -61,15 +61,32 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
var attPostArr = new List<dynamic>();
|
|
|
|
var attPostArr = new List<dynamic>();
|
|
|
|
foreach (var file in req.FileList)
|
|
|
|
foreach (var file in req.FileList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//var opt = App.GetOptions<TempFileOptions>().Path;
|
|
|
|
var basePath = AppSetting.app(new string[] { "FileSettings", "BasePath" });
|
|
|
|
//var fileFullPath = Path.Combine(App.WebHostEnvironment.WebRootPath, opt);
|
|
|
|
var relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
|
|
|
|
//var fileFullName = Path.Combine(fileFullPath, file);
|
|
|
|
var dirAbs = string.Empty;
|
|
|
|
|
|
|
|
var fileRelaPath = string.Empty;
|
|
|
|
|
|
|
|
var fileAbsPath = string.Empty;
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(basePath))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dirAbs = Path.Combine(_environment.WebRootPath, relativePath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dirAbs = Path.Combine(basePath, relativePath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var fileFullName = Path.Combine(dirAbs, file);
|
|
|
|
|
|
|
|
fileFullName = fileFullName.Replace(".OpApi", ".MainApi");
|
|
|
|
|
|
|
|
|
|
|
|
//attPostArr.Add(new
|
|
|
|
if (!File.Exists(fileFullName))
|
|
|
|
//{
|
|
|
|
{
|
|
|
|
// AttachName = Path.GetFileName(file),
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("附件不存在,请检查"));
|
|
|
|
// AttachContent = Convert.ToBase64String(File.ReadAllBytes(fileFullName))
|
|
|
|
}
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
|
|
attPostArr.Add(new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AttachName = Path.GetFileName(file),
|
|
|
|
|
|
|
|
AttachContent = Convert.ToBase64String(File.ReadAllBytes(fileFullName))
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var mailJson = new dynamic[]{
|
|
|
|
var mailJson = new dynamic[]{
|
|
|
|