Browse Source

上传接口

lichunlei 8 months ago
parent
commit
98e0c13d65
1 changed files with 21 additions and 3 deletions
  1. 21 3
      Controllers/Client/UploadController.cs

+ 21 - 3
Controllers/Client/UploadController.cs

@@ -24,10 +24,28 @@ namespace Controllers.Client
         }
 
         /// <summary>
-        /// 用户基本信息
+        /// 上传图片
         /// </summary>
-        /// <param name="param">参数请求体</param>
-        /// <returns>用户基本信息</returns>
+        /// <param name="file">文件对象</param>
+        /// <returns>上传图片</returns>
+        [HttpPut]
+        [Route("/v1/omega_upload/uploadImage")]
+        public IActionResult uploadImage(IFormFile file)
+        {
+            string path = _UploadService.getPicPath(file);
+            Dictionary<string, string> obj = new();
+            var option = App.OptionsSetting;
+            obj.Add("uploadUrl", option.Upload.UploadUrl + path);
+            obj.Add("saveUrl", path);
+            return SUCCESS(obj);
+        }
+
+
+        /// <summary>
+        /// 上传文件
+        /// </summary>
+        /// <param name="file">文件对象</param>
+        /// <returns>上传文件</returns>
         [HttpPut]
         [Route("/v1/omega_upload/uploadfile")]
         public IActionResult uploadFile(IFormFile file)