bugfix: 文件上传时,folder不传会产生null路径

main
陈伟 2 months ago
parent 6cba07cfa0
commit 0c559db1cb

@ -1,4 +1,5 @@
using System.Text;
using Castle.Core.Internal;
using Infrastructure;
using Infrastructure.CloudSdk.wayline;
using Microsoft.AspNetCore.Authorization;
@ -262,6 +263,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
return await _app.GetTaskPicList(flightId, timestamp);
}
#endregion
#region 航线管理
@ -356,6 +358,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
return await _app.DeleteAirLine(id);
}
/// <summary>
/// 上传航线文件
/// </summary>
@ -368,6 +371,11 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
if (xmlFile == null || xmlFile.Length == 0)
return BadRequest("文件为空");
if (string.IsNullOrEmpty(folder))
{
folder = "";
}
var path = await _app.UploadFile(xmlFile, folder);
return Ok(new { message = "上传成功", path });
}

Loading…
Cancel
Save