From 437b5cd5f34c9c2f16c6a939b178afe6cdb64f27 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期四, 21 七月 2022 18:56:48 +0800
Subject: [PATCH] 用户清单导入

---
 VueWebApi/Controllers/ImportExcelController.cs |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/VueWebApi/Controllers/ImportExcelController.cs b/VueWebApi/Controllers/ImportExcelController.cs
index 3aec6a1..546bdaf 100644
--- a/VueWebApi/Controllers/ImportExcelController.cs
+++ b/VueWebApi/Controllers/ImportExcelController.cs
@@ -38,7 +38,7 @@
             list = list.Where(s => s.FileCode == FileCode).ToList();
             var filename = list[0].FileName + ".xls";
             string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"];
-            var msg = fileip + "/apis/Excel/" + filename;
+            var msg = fileip + "/Excel/" + filename;
             mes.code = "200";
             mes.data = msg;
             return TJson.toJson(mes);
@@ -53,9 +53,12 @@
         /// <param name="FileCode">鏂囦欢缂栫爜</param>
         /// <returns></returns>
         [Route(template: "ExcelModelCheck")]
-        [HttpGet]
-        public HttpResponseMessage ExcelModelCheck(HttpPostedFileBase files, string FileCode = null)
+        [HttpPost]
+        public HttpResponseMessage ExcelModelCheck()
         {
+
+            string FileCode = HttpContext.Current.Request["FileCode"].ToString();
+            HttpPostedFile files = HttpContext.Current.Request.Files[0];
             ExcelModelCheck list = new ExcelModelCheck();
             Dictionary<object, object> dList = new Dictionary<object, object>();
             list.json1 = ExcelCheckUpload(files, FileCode);  //鏂囦欢涓婁紶
@@ -90,7 +93,7 @@
         [Route(template: "ExcelCheckUpload")]
         [HttpGet]
         [HiddenApi]
-        public ToMessage ExcelCheckUpload(HttpPostedFileBase files, string FileCode = null)
+        public ToMessage ExcelCheckUpload(HttpPostedFile files, string FileCode = null)
         {
             try
             {
@@ -145,7 +148,7 @@
         [Route(template: "ExcelCheckUpload")]
         [HttpGet]
         [HiddenApi]
-        public ToMessage ExcelCheck(HttpPostedFileBase files, string FileCode = null)
+        public ToMessage ExcelCheck(HttpPostedFile files, string FileCode = null)
         {
             try
             {
@@ -186,7 +189,7 @@
         /// <param name="FileCode">鏂囦欢缂栫爜</param>
         /// <returns></returns>
         [HiddenApi]
-        public ToMessage ExcelCheckCount(HttpPostedFileBase files, string FileCode = null)
+        public ToMessage ExcelCheckCount(HttpPostedFile files, string FileCode = null)
         {
             string savePath;
 

--
Gitblit v1.9.3