public async Task <IActionResult> UploadImage(IFormFile file, FileUploadRequest request) { //var file = Request.Form.Files[0]; yoshop_upload_file upload; try { var result = _ = await FileUpload(file); if (result.Code == 0) { return(No(result.Msg)); } upload = new yoshop_upload_file { create_time = DateTimeExtensions.GetCurrentTimeStamp(), file_type = "image", storage = "local", is_delete = 0, group_id = request.group_id, file_size = request.size, file_url = result.Msg, file_name = request.name, extension = Path.GetExtension(request.name).TrimStart('.'), wxapp_id = GetAdminSession().wxapp_id }; UploadFileService.AddEntity(upload); } catch (Exception e) { LogManager.Error(GetType(), e); return(No(e.Message)); } return(YesResult("图片上传成功!", upload)); }