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