Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Oct 14, 2023
2 parents 83cb4e6 + 5fe187c commit 4e4a6bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions NewLife.Cube/CubeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.WebEncoders;
using Microsoft.Net.Http.Headers;
using NewLife.Caching.Services;
using NewLife.Caching;
using NewLife.Common;
using NewLife.Cube.Modules;
using NewLife.Cube.Services;
Expand All @@ -17,6 +19,7 @@
using Stardust;
using Stardust.Registry;
using XCode.DataAccessLayer;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace NewLife.Cube;

Expand Down Expand Up @@ -114,6 +117,9 @@ public static IServiceCollection AddCube(this IServiceCollection services)
options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
});

//默认注入缓存实现
services.TryAddSingleton<ICacheProvider, CacheProvider>();

// UI服务
services.AddSingleton<PasswordService>();
services.AddSingleton<UserService>();
Expand Down
4 changes: 4 additions & 0 deletions NewLife.CubeNC/CubeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.WebEncoders;
using Microsoft.Net.Http.Headers;
using NewLife.Caching;
using NewLife.Common;
using NewLife.Cube.Extensions;
using NewLife.Cube.Modules;
Expand Down Expand Up @@ -161,6 +163,8 @@ public static IServiceCollection AddCube(this IServiceCollection services)
// 支持中文编码
options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
});
//默认注入缓存实现
services.TryAddSingleton<ICacheProvider, CacheProvider>();

// UI服务
services.AddSingleton<UIService>();
Expand Down

0 comments on commit 4e4a6bc

Please sign in to comment.