Browse Source

Merge pull request #10831 from abpframework/auto-merge/rel-5-0/678

Merge branch dev with rel-5.0
pull/10849/head
maliming 5 years ago
committed by GitHub
parent
commit
44f0b07e5e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
  2. 7
      modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs
  3. 7
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs

17
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs

@ -83,13 +83,16 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency
version = latestVersion;
}
var nugetVersion = (await GetTemplateNugetVersionAsync(name, type, version)) ?? version;
if (await GetTemplateNugetVersionAsync(name, type, version) == null)
{
throw new Exception("There is no version found with given version: " + version);
}
if (!string.IsNullOrWhiteSpace(templateSource) && !IsNetworkSource(templateSource))
{
Logger.LogInformation("Using local " + type + ": " + name + ", version: " + version);
return new TemplateFile(File.ReadAllBytes(Path.Combine(templateSource, name + "-" + version + ".zip")),
version, latestVersion, nugetVersion);
version, latestVersion, version);
}
var localCacheFile = Path.Combine(CliPaths.TemplateCache, name.Replace("/", ".") + "-" + version + ".zip");
@ -97,14 +100,14 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency
#if DEBUG
if (File.Exists(localCacheFile))
{
return new TemplateFile(File.ReadAllBytes(localCacheFile), version, latestVersion, nugetVersion);
return new TemplateFile(File.ReadAllBytes(localCacheFile), version, latestVersion, version);
}
#endif
if (Options.CacheTemplates && File.Exists(localCacheFile) && templateSource.IsNullOrWhiteSpace())
{
Logger.LogInformation("Using cached " + type + ": " + name + ", version: " + version);
return new TemplateFile(File.ReadAllBytes(localCacheFile), version, latestVersion, nugetVersion);
return new TemplateFile(File.ReadAllBytes(localCacheFile), version, latestVersion, version);
}
Logger.LogInformation("Downloading " + type + ": " + name + ", version: " + version);
@ -125,7 +128,7 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency
File.WriteAllBytes(localCacheFile, fileContent);
}
return new TemplateFile(fileContent, version, latestVersion, nugetVersion);
return new TemplateFile(fileContent, version, latestVersion, version);
}
private async Task<string> GetLatestSourceCodeVersionAsync(string name, string type, string url = null,
@ -141,7 +144,7 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency
var client = _cliHttpClientFactory.CreateClient();
var stringContent = new StringContent(
JsonSerializer.Serialize(new GetLatestSourceCodeVersionDto
{ Name = name, IncludePreReleases = includePreReleases }),
{Name = name, IncludePreReleases = includePreReleases}),
Encoding.UTF8,
MimeTypes.Application.Json
);
@ -174,7 +177,7 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency
var client = _cliHttpClientFactory.CreateClient();
var stringContent = new StringContent(
JsonSerializer.Serialize(new GetTemplateNugetVersionDto { Name = name, Version = version }),
JsonSerializer.Serialize(new GetTemplateNugetVersionDto {Name = name, Version = version}),
Encoding.UTF8,
MimeTypes.Application.Json
);

7
modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
@ -11,6 +12,7 @@ using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
using Volo.Blogging.Bundling;
using Volo.Blogging.Files;
using Volo.Blogging.Localization;
namespace Volo.Blogging
@ -78,6 +80,11 @@ namespace Volo.Blogging
{
options.DisableModule(BloggingRemoteServiceConsts.ModuleName);
});
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(FileUploadInputDto));
});
}
}
}

7
modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.CmsKit.Admin.Web.Menus;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.Modularity;
@ -12,6 +13,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars;
using Volo.Abp.Localization;
using Volo.Abp.AutoMapper;
using Volo.Abp.Http.ProxyScripting.Generators.JQuery;
using Volo.CmsKit.Admin.MediaDescriptors;
namespace Volo.CmsKit.Admin.Web;
@ -158,5 +160,10 @@ public class CmsKitAdminWebModule : AbpModule
{
options.DisableModule(CmsKitAdminRemoteServiceConsts.ModuleName);
});
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(CreateMediaInputWithStream));
});
}
}

Loading…
Cancel
Save