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;
@ -249,7 +250,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
return await _app.DeleteTask(id);
}
/// <summary>
/// 根据flightId查询指令拍摄图片
/// </summary>
@ -258,10 +259,11 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public async Task<Response<string>> GetTaskPicList(string flightId,long timestamp)
public async Task<Response<string>> GetTaskPicList(string flightId, long timestamp)
{
return await _app.GetTaskPicList(flightId,timestamp);
return await _app.GetTaskPicList(flightId, timestamp);
}
#endregion
#region 航线管理
@ -356,6 +358,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
return await _app.DeleteAirLine(id);
}
/// <summary>
/// 上传航线文件
/// </summary>
@ -364,11 +367,16 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
/// <returns></returns>
[HttpPost("upload")]
[AllowAnonymous]
public async Task<IActionResult> UploadXmlFile(IFormFile xmlFile,string folder)
public async Task<IActionResult> UploadXmlFile(IFormFile xmlFile, string folder)
{
if (xmlFile == null || xmlFile.Length == 0)
return BadRequest("文件为空");
var path = await _app.UploadFile(xmlFile,folder);
if (string.IsNullOrEmpty(folder))
{
folder = "";
}
var path = await _app.UploadFile(xmlFile, folder);
return Ok(new { message = "上传成功", path });
}
/*/// <summary>

Loading…
Cancel
Save