From f048afe6e62af3c30ebdceea663c72b78c7e3ccc Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 01 八月 2023 13:55:40 +0800 Subject: [PATCH] 1 --- ExportMap/Controllers/UploadController.cs | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/ExportMap/Controllers/UploadController.cs b/ExportMap/Controllers/UploadController.cs index bc3e567..56a4741 100644 --- a/ExportMap/Controllers/UploadController.cs +++ b/ExportMap/Controllers/UploadController.cs @@ -14,8 +14,13 @@ public class UploadController : ApiController { [HttpPost] - public Task<IEnumerable<FileDesc>> Post([FromUri]string path) + public Task<IEnumerable<FileDesc>> Post([FromUri] string path, [FromUri] string token) { + if (string.IsNullOrEmpty(token) || !ExportUtil.VerifyToken(token)) + { + throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.Unauthorized, "浠ょ墝涓虹┖鎴栨棤鏁堬紒")); + } + //string root = HttpContext.Current.Server.MapPath("~/uploads"); if (string.IsNullOrEmpty(path)) return null; string root = Path.Combine(Tools.GetSetting("tempFolder"), path); -- Gitblit v1.9.3