|
|
|
@ -453,9 +453,31 @@ namespace _24Hour.Controllers
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// download file for video repot module |
|
|
|
|
/// </summary> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
[HttpGet, AllowAnonymous] |
|
|
|
|
[Route("download")] |
|
|
|
|
public IActionResult DownloadFile(string filepath) |
|
|
|
|
{ |
|
|
|
|
var fileaddr = Path.Combine(Environment.CurrentDirectory,"wwwroot"); |
|
|
|
|
fileaddr += filepath; |
|
|
|
|
if (System.IO.File.Exists(fileaddr) == false) |
|
|
|
|
{ |
|
|
|
|
return new BadRequestResult(); |
|
|
|
|
} |
|
|
|
|
return new FileStreamResult(new FileStream(path: fileaddr, FileMode.Open), "application/octet-stream") |
|
|
|
|
{ |
|
|
|
|
FileDownloadName = Path.GetFileName(fileaddr), |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class UserLogin |
|
|
|
|
{ |
|
|
|
|
[DataMember] |
|
|
|
|