wanshenmean
4 天以前 64a2aa2301946f777659239247233e47ad1e3076
Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseController/ApiBaseController.cs
@@ -16,11 +16,11 @@
    [Authorize, ApiController]
    public class ApiBaseController<IService, TEntity> : Controller
    {
        protected IService Service;
        protected readonly IService Service;
        public ApiBaseController(IService service)
        {
            Service = service;
            Service = service ?? throw new ArgumentNullException(nameof(service));
        }
        /// <summary>
@@ -108,12 +108,12 @@
        [HttpPost, Route("Export")]
        public virtual ActionResult Export([FromBody] PageDataOptions loadData)
        {
            WebResponseContent result = InvokeService("Export", new object[] { loadData }) as WebResponseContent;
            if (result.Status)
            WebResponseContent? result = InvokeService("Export", new object[] { loadData }) as WebResponseContent;
            if (result != null && result.Status && result.Data != null)
                return File(
                       System.IO.File.ReadAllBytes(result.Data.ToString()),
                       System.IO.File.ReadAllBytes(result.Data.ToString() ?? string.Empty),
                       System.Net.Mime.MediaTypeNames.Application.Octet,
                       Path.GetFileName(result.Data.ToString())
                       Path.GetFileName(result.Data.ToString() ?? string.Empty) ?? string.Empty
                   );
            return Json(result);
        }
@@ -125,12 +125,12 @@
        [HttpPost, HttpGet, Route("DownLoadTemplate")]
        public virtual ActionResult DownLoadTemplate()
        {
            WebResponseContent result = InvokeService("DownLoadTemplate", new object[] { }) as WebResponseContent;
            if (result.Status)
            WebResponseContent? result = InvokeService("DownLoadTemplate", new object[] { }) as WebResponseContent;
            if (result != null && result.Status && result.Data != null)
                return File(
                       System.IO.File.ReadAllBytes(result.Data.ToString()),
                       System.IO.File.ReadAllBytes(result.Data.ToString() ?? string.Empty),
                       System.Net.Mime.MediaTypeNames.Application.Octet,
                       Path.GetFileName(result.Data.ToString())
                       Path.GetFileName(result.Data.ToString() ?? string.Empty) ?? string.Empty
                   );
            return Json(result);
        }