private async Task <int> CreateArticle(CreateAndEditArticleViewModel vm, AjaxResponse ajaxResponse) { var article = new Article.Article() { Title = vm.Title, Content = Base64.base64Decode(vm.Content), Description = vm.Description, Source = vm.Source, CoverImg = vm.CoverImg, CategoryName = vm.CategoryName, Status = vm.Status ?? 0, CreateTime = DateTime.Now, UpdateTime = DateTime.Now }; var r = await _articleManager.CreateAsync(article); if (r.Succeeded) { return(article.Id); } _logger.LogWarning("添加文章失败"); ajaxResponse.Errors.Add(new ErrorInfo(-1, r.Errors.FirstOrDefault()?.Description ?? "添加文章失败")); return(0); }