liyuanyuan 3 年 前
コミット
f1cce05f95
共有3 個のファイルを変更した15 個の追加12 個の削除を含む
  1. 1 0
      .gitignore
  2. 1 1
      RMYY_CallCenter_Api.Utility/Helper/FileHelper.cs
  3. 13 11
      RMYY_CallCenter_Api/Controllers/ApplicationsRefreshController.cs

+ 1 - 0
.gitignore

@@ -26,3 +26,4 @@ packages/
26 26
 /RMYY_CallCenter_Api/Upload/Files/2022/11/01
27 27
 /RMYY_CallCenter_Api/Upload/Files/2022/11/17/(20221117172518119)1.jpg
28 28
 /RMYY_CallCenter_Api/ExcelData
29
+/RMYY_CallCenter_Api/Upload/version

+ 1 - 1
RMYY_CallCenter_Api.Utility/Helper/FileHelper.cs

@@ -87,7 +87,7 @@ namespace RMYY_CallCenter_Api.Utility
87 87
             }
88 88
         }
89 89
 
90
-        public static string Upload(HttpPostedFile hpFile, string path, string names)
90
+        public static string Upload(HttpPostedFileBase hpFile, string path, string names)
91 91
         {
92 92
             path = HttpContext.Current.Server.MapPath("..") + "/" + path;
93 93
             string fileType = hpFile.FileName.Substring(hpFile.FileName.LastIndexOf("."));

+ 13 - 11
RMYY_CallCenter_Api/Controllers/ApplicationsRefreshController.cs

@@ -115,11 +115,11 @@ namespace RMYY_CallCenter_Api.Controllers
115 115
         /// 上传附件
116 116
         /// </summary>
117 117
         /// <returns></returns>
118
-        public ActionResult UploadFile()
118
+        public ActionResult UploadFile(string appliName,string versionCode)
119 119
         {
120 120
             string name = string.Empty;
121
-            string appliName = RequestString.GetFormString("appliName");
122
-            string versionCode = RequestString.GetFormString("versionCode");
121
+            //string appliName = RequestString.GetFormString("appliName");
122
+            //string versionCode = RequestString.GetFormString("versionCode");
123 123
             //if (string.IsNullOrWhiteSpace(appliName))
124 124
             //{
125 125
             //    return Error("应用名称不能为空");
@@ -133,14 +133,16 @@ namespace RMYY_CallCenter_Api.Controllers
133 133
             {
134 134
                 return Error("应用名称或版本号已存在");
135 135
             }
136
-            HttpFileCollection files = RequestString.GetFiles();
136
+            HttpFileCollectionBase files = Request.Files;
137
+            
137 138
             if (files.Count > 0)
138 139
             {
139 140
                 string path = "Upload/version/";   // + DateTime.Now.ToString("yyyy") + "/" + DateTime.Now.ToString("MM") + "/" + DateTime.Now.ToString("dd") + "/";
140 141
                 for (int i = 0; i < files.Count; i++)
141 142
                 {
142
-                    HttpPostedFile file = files[i];
143 143
                   
144
+                    HttpPostedFileBase file = files[i];
145
+
144 146
                     if (!fileExtension.Contains((Path.GetExtension(file.FileName).ToLower())))
145 147
                     {
146 148
                         return Error("app格式不正确");
@@ -164,15 +166,15 @@ namespace RMYY_CallCenter_Api.Controllers
164 166
         public ActionResult SaveInfo()
165 167
         {
166 168
             int id = RequestString.GetInt("id", 0);
167
-            string appliName = RequestString.GetFormString("appliName");
168
-            string versionName = RequestString.GetFormString("versionName");
169
-            string versionCode = RequestString.GetFormString("versionCode");
170
-            string downUrl = RequestString.GetFormString("files");
169
+            string appliName = RequestString.GetQueryString("appliName");
170
+            string versionName = RequestString.GetQueryString("versionName");
171
+            string versionCode = RequestString.GetQueryString("versionCode");
172
+            string downUrl = RequestString.GetQueryString("files");
171 173
             int userId = RequestString.GetInt("userId", 0);
172
-            string userCode = RequestString.GetFormString("userCode");
174
+            string userCode = RequestString.GetQueryString("userCode");
173 175
             int isDelete = RequestString.GetInt("isDelete", 0);
174 176
             int order = RequestString.GetInt("order", 0);
175
-            string note = RequestString.GetFormString("note");
177
+            string note = RequestString.GetQueryString("note");
176 178
 
177 179
         
178 180
             if (string.IsNullOrWhiteSpace(versionCode))