完成验证码及登录功能

This commit is contained in:
橙子
2023-02-04 18:06:42 +08:00
parent cfd25b0a8d
commit b01d242cbc
276 changed files with 24201 additions and 22 deletions

View File

@@ -53,7 +53,7 @@ namespace Yi.Framework.Auth.JwtBearer.Authentication
resp = p.GetString();
break;
case JsonValueKind.Number:
resp = p.GetInt32().ToString();
resp = p.GetInt64().ToString();
break;
}
claims.Add(new Claim(claim.Key, resp ?? ""));

View File

@@ -0,0 +1,410 @@
/*MIT License
Copyright(c) 2017 Mirza Ghulam Rasyid
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
namespace Yi.Framework.ThumbnailSharp
{
/// <summary>
/// Image format to use when creating a thumbnail.
/// </summary>
public enum Format
{
Jpeg,
Bmp,
Png,
Gif,
Tiff
}
/// <summary>
/// Thumbnail class that holds various methods to create an image thumbnail.
/// </summary>
public class ThumbnailSharpManager
{
private Bitmap CreateBitmapThumbnail(uint thumbnailSize, string imageFileLocation)
{
Bitmap bitmap = null;
Image image = null;
float actualHeight = default(float);
float actualWidth = default(float);
uint thumbnailHeight = default(uint);
uint thumbnailWidth = default(uint);
try
{
image = Image.FromFile(imageFileLocation);
}
catch
{
if (image != null)
image = null;
}
if (image != null)
{
actualHeight = image.Height;
actualWidth = image.Width;
if (actualHeight > actualWidth)
{
if ((uint)actualHeight <= thumbnailSize)
throw new Exception("Thumbnail size must be less than actual height (portrait image)");
thumbnailHeight = thumbnailSize;
thumbnailWidth = (uint)((actualWidth / actualHeight) * thumbnailSize);
}
else if (actualWidth > actualHeight)
{
if ((uint)actualWidth <= thumbnailSize)
throw new Exception("Thumbnail size must be less than actual width (landscape image)");
thumbnailWidth = thumbnailSize;
thumbnailHeight = (uint)((actualHeight / actualWidth) * thumbnailSize);
}
else
{
if ((uint)actualWidth <= thumbnailSize)
throw new Exception("Thumbnail size must be less than image's size");
thumbnailWidth = thumbnailSize;
thumbnailHeight = thumbnailSize;
}
try
{
bitmap = new Bitmap((int)thumbnailWidth, (int)thumbnailHeight);
Graphics resizedImage = Graphics.FromImage(bitmap);
resizedImage.InterpolationMode = InterpolationMode.HighQualityBicubic;
resizedImage.CompositingQuality = CompositingQuality.HighQuality;
resizedImage.SmoothingMode = SmoothingMode.HighQuality;
resizedImage.DrawImage(image, 0, 0, thumbnailWidth, thumbnailHeight);
}
catch
{
if (bitmap != null)
bitmap = null;
}
}
return bitmap;
}
private Bitmap CreateBitmapThumbnail(uint thumbnailSize, Stream imageStream)
{
Bitmap bitmap = null;
Image image = null;
float actualHeight = default(float);
float actualWidth = default(float);
uint thumbnailHeight = default(uint);
uint thumbnailWidth = default(uint);
try
{
image = Image.FromStream(imageStream);
}
catch
{
if (image != null)
image = null;
}
if (image != null)
{
actualHeight = image.Height;
actualWidth = image.Width;
if (actualHeight > actualWidth)
{
if ((uint)actualHeight <= thumbnailSize)
throw new Exception("Thumbnail size must be less than actual height (portrait image)");
thumbnailHeight = thumbnailSize;
thumbnailWidth = (uint)((actualWidth / actualHeight) * thumbnailSize);
}
else if (actualWidth > actualHeight)
{
if ((uint)actualWidth <= thumbnailSize)
throw new Exception("Thumbnail size must be less than actual width (landscape image)");
thumbnailWidth = thumbnailSize;
thumbnailHeight = (uint)((actualHeight / actualWidth) * thumbnailSize);
}
else
{
if ((uint)actualWidth <= thumbnailSize)
throw new Exception("Thumbnail size must be less than image's size");
thumbnailWidth = thumbnailSize;
thumbnailHeight = thumbnailSize;
}
try
{
bitmap = new Bitmap((int)thumbnailWidth, (int)thumbnailHeight);
Graphics resizedImage = Graphics.FromImage(bitmap);
resizedImage.InterpolationMode = InterpolationMode.HighQualityBicubic;
resizedImage.CompositingQuality = CompositingQuality.HighQuality;
resizedImage.SmoothingMode = SmoothingMode.HighQuality;
resizedImage.DrawImage(image, 0, 0, thumbnailWidth, thumbnailHeight);
}
catch
{
if (bitmap != null)
bitmap = null;
}
}
return bitmap;
}
private ImageFormat GetImageFormat(Format format)
{
switch (format)
{
case Format.Jpeg:
return ImageFormat.Jpeg;
case Format.Bmp:
return ImageFormat.Bmp;
case Format.Png:
return ImageFormat.Png;
case Format.Gif:
return ImageFormat.Gif;
default:
return ImageFormat.Tiff;
}
}
private async Task<Stream> GetImageStreamFromUrl(Uri urlAddress)
{
Stream result = null;
try
{
byte[] bytes = await GetImageBytesFromUrl(urlAddress);
result = new MemoryStream(bytes);
}
catch
{
result = null;
}
return result;
}
private async Task<byte[]> GetImageBytesFromUrl(Uri urlAddress)
{
byte[] buffer = null;
try
{
using (HttpClient client = new HttpClient())
{
buffer = await client.GetByteArrayAsync(urlAddress);
}
}
catch
{
buffer = null;
}
return buffer;
}
/// <summary>
/// Create a thumbnail from file and returns as stream.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="imageFileLocation">Correct image file location.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as stream. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'imageFileLocation' is null.</exception>
/// <exception cref="FileNotFoundException">'imageFileLocation' does not exist.</exception>
public Stream CreateThumbnailStream(uint thumbnailSize, string imageFileLocation, Format imageFormat)
{
if (String.IsNullOrEmpty(imageFileLocation))
throw new ArgumentNullException(nameof(imageFileLocation), "'imageFileLocation' cannot be null");
if (!File.Exists(imageFileLocation))
throw new FileNotFoundException($"'{imageFileLocation}' cannot be found");
Bitmap bitmap = CreateBitmapThumbnail(thumbnailSize, imageFileLocation);
if (bitmap != null)
{
MemoryStream stream = new MemoryStream();
bitmap.Save(stream, GetImageFormat(imageFormat));
stream.Position = 0;
return stream;
}
return null;
}
/// <summary>
/// Create a thumbnail from image stream and returns as stream.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="imageStream">Valid image stream object.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as stream. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'imageStream' is null.</exception>
public Stream CreateThumbnailStream(uint thumbnailSize, Stream imageStream, Format imageFormat)
{
if (imageStream == null)
throw new ArgumentNullException(nameof(imageStream), "'imageStream' cannot be null");
Bitmap bitmap = CreateBitmapThumbnail(thumbnailSize, imageStream);
if (bitmap != null)
{
MemoryStream stream = new MemoryStream();
bitmap.Save(stream, GetImageFormat(imageFormat));
stream.Position = 0;
return stream;
}
return null;
}
/// <summary>
/// Create a thumbnail from image in bytes and returns as stream.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="imageBytes">Valid image bytes array.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as stream. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'imageBytes' is null.</exception>
public Stream CreateThumbnailStream(uint thumbnailSize, byte[] imageBytes, Format imageFormat)
{
if (imageBytes == null)
throw new ArgumentNullException(nameof(imageBytes), "'imageStream' cannot be null");
Bitmap bitmap = CreateBitmapThumbnail(thumbnailSize, new MemoryStream(imageBytes));
if (bitmap != null)
{
MemoryStream stream = new MemoryStream();
bitmap.Save(stream, GetImageFormat(imageFormat));
stream.Position = 0;
return stream;
}
return null;
}
/// <summary>
/// Create a thumbnail from file and returns as bytes.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="imageFileLocation">Correct image file location.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as bytes. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'imageFileLocation' is null.</exception>
/// <exception cref="FileNotFoundException">'imageFileLocation' does not exist.</exception>
public byte[] CreateThumbnailBytes(uint thumbnailSize, string imageFileLocation, Format imageFormat)
{
if (String.IsNullOrEmpty(imageFileLocation))
throw new ArgumentNullException(nameof(imageFileLocation), "'imageFileLocation' cannot be null");
if (!File.Exists(imageFileLocation))
throw new FileNotFoundException($"'{imageFileLocation}' cannot be found");
Stream stream = CreateThumbnailStream(thumbnailSize, imageFileLocation, imageFormat);
if (stream != null)
{
byte[] streamBytes = new byte[stream.Length];
stream.Read(streamBytes, 0, streamBytes.Length);
return streamBytes;
}
return null;
}
/// <summary>
/// Create a thumbnail from image stream and returns as bytes.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="imageStream">Valid image stream object.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as bytes. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'imageStream' is null.</exception>
public byte[] CreateThumbnailBytes(uint thumbnailSize, Stream imageStream, Format imageFormat)
{
if (imageStream == null)
throw new ArgumentNullException(nameof(imageStream), "'imageStream' cannot be null");
Stream stream = CreateThumbnailStream(thumbnailSize, imageStream, imageFormat);
if (stream != null)
{
byte[] streamBytes = new byte[stream.Length];
stream.Read(streamBytes, 0, streamBytes.Length);
return streamBytes;
}
return null;
}
/// <summary>
/// Create a thumbnail from image in bytes and returns as bytes.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="imageBytes">Valid image bytes array.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as bytes. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'imageBytes' is null.</exception>
public byte[] CreateThumbnailBytes(uint thumbnailSize, byte[] imageBytes, Format imageFormat)
{
if (imageBytes == null)
throw new ArgumentNullException(nameof(imageBytes), "'imageStream' cannot be null");
Stream stream = CreateThumbnailStream(thumbnailSize, imageBytes, imageFormat);
if (stream != null)
{
byte[] streamBytes = new byte[stream.Length];
stream.Read(streamBytes, 0, streamBytes.Length);
return streamBytes;
}
return null;
}
/// <summary>
/// Create a thumbnail from valid image url asynchronously.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="urlAddress">Valid absolute url address with proper scheme.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as stream. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'urlAddress' is null.</exception>
public async Task<Stream> CreateThumbnailStreamAsync(uint thumbnailSize, Uri urlAddress, Format imageFormat)
{
if (urlAddress == null)
throw new ArgumentNullException(nameof(urlAddress), "'urlAddress' cannot be null");
Stream result = null;
Stream stream = await GetImageStreamFromUrl(urlAddress);
if (stream != null)
{
result = CreateThumbnailStream(thumbnailSize, stream, imageFormat);
}
return result;
}
/// <summary>
/// Create a thumbnail from valid image url asynchronously.
/// </summary>
/// <param name="thumbnailSize">Thumbnail size. For portrait image, thumbnail size must be less than its height.
/// For landscape image, thumbnail size must be less than its width. For the same size image (Proportional), thumbnail size must be less than its width and height.</param>
/// <param name="urlAddress">Valid absolute url address with proper scheme.</param>
/// <param name="imageFormat">Image format to use.</param>
/// <returns>A thumbnail image as bytes. Returns null if it fails.</returns>
/// <exception cref="ArgumentNullException">'urlAddress' is null.</exception>
public async Task<byte[]> CreateThumbnailBytesAsync(uint thumbnailSize, Uri urlAddress, Format imageFormat)
{
if (urlAddress == null)
throw new ArgumentNullException(nameof(urlAddress), "'urlAddress' cannot be null");
byte[] result = null;
byte[] imageBytes = await GetImageBytesFromUrl(urlAddress);
if (imageBytes != null)
{
result = CreateThumbnailBytes(thumbnailSize, imageBytes, imageFormat);
}
return result;
}
}
}

View File

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\framework\Yi.Framework.Core\Yi.Framework.Core.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using StartupModules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.ThumbnailSharp
{
public class YiFrameworkThumbnailSharpModule : IStartupModule
{
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
{
}
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
{
services.AddSingleton<ThumbnailSharpManager>();
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Application.Contracts.Identity.Dtos.Account
{
public class CaptchaImageDto
{
public string Uuid { get; set; }=string.Empty;
public byte[] Img { get; set; }
}
}

View File

@@ -11,6 +11,31 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Yi.RBAC.Application.Identity.AccountService.Get">
<summary>
查询已登录的账户信息
</summary>
<returns></returns>
<exception cref="T:Yi.Framework.Core.Exceptions.AuthException"></exception>
</member>
<member name="M:Yi.RBAC.Application.Identity.AccountService.GetVue3Router">
<summary>
获取当前登录用户的前端路由
</summary>
<returns></returns>
</member>
<member name="M:Yi.RBAC.Application.Identity.AccountService.PostLogout">
<summary>
退出登录
</summary>
<returns></returns>
</member>
<member name="M:Yi.RBAC.Application.Identity.AccountService.GetCaptchaImage">
<summary>
生成验证码
</summary>
<returns></returns>
</member>
<member name="T:Yi.RBAC.Application.Identity.DeptService">
<summary>
Dept服务实现

View File

@@ -1,5 +1,10 @@
using Microsoft.AspNetCore.Identity;
using Hei.Captcha;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using NET.AutoWebApi.Setting;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -7,13 +12,20 @@ using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Auth.JwtBearer.Authentication;
using Yi.Framework.Core.CurrentUsers;
using Yi.Framework.Core.Enums;
using Yi.Framework.Core.Exceptions;
using Yi.Framework.Ddd.Repositories;
using Yi.Framework.Ddd.Services;
using Yi.Framework.ThumbnailSharp;
using Yi.RBAC.Application.Contracts.Account.Dtos;
using Yi.RBAC.Application.Contracts.Identity;
using Yi.RBAC.Application.Contracts.Identity.Dtos.Account;
using Yi.RBAC.Domain.Identity;
using Yi.RBAC.Domain.Identity.Dtos;
using Yi.RBAC.Domain.Identity.Entities;
using Yi.RBAC.Domain.Identity.Repositories;
using Yi.RBAC.Domain.Shared.Identity.ConstClasses;
using Yi.RBAC.Domain.Shared.Identity.Dtos;
namespace Yi.RBAC.Application.Identity
{
@@ -29,12 +41,17 @@ namespace Yi.RBAC.Application.Identity
[Autowired]
private AccountManager _accountManager { get; set; }
[Autowired]
private IRepository<MenuEntity> _menuRepository { get; set; }
[Autowired]
private SecurityCodeHelper _securityCode { get; set; }
/// <summary>
/// 登录
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<string> PostLoginAsync(LoginInputVo input)
public async Task<object> PostLoginAsync(LoginInputVo input)
{
UserEntity user = new();
//登录成功
@@ -50,7 +67,79 @@ namespace Yi.RBAC.Application.Identity
//创建token
var token = _jwtTokenManager.CreateToken(_accountManager.UserInfoToClaim(userInfo));
return token;
return new { Token = token };
}
/// <summary>
/// 查询已登录的账户信息
/// </summary>
/// <returns></returns>
/// <exception cref="AuthException"></exception>
[Route("/api/account")]
[Authorize]
public async Task<UserRoleMenuDto> Get()
{
//通过鉴权jwt获取到用户的id
var userId = _currentUser.Id;
//此处从缓存中获取即可
//var data = _cacheDb.Get<UserRoleMenuDto>($"Yi:UserInfo:{userId}");
var data = await _userRepository.GetUserAllInfoAsync(userId);
//系统用户数据被重置,老前端访问重新授权
if (data is null)
{
throw new AuthException();
}
data.Menus.Clear();
return data;
}
/// <summary>
/// 获取当前登录用户的前端路由
/// </summary>
/// <returns></returns>
[Authorize]
public async Task<List<Vue3RouterDto>> GetVue3Router()
{
var userId = _currentUser.Id;
var data = await _userRepository.GetUserAllInfoAsync(userId);
var menus = data.Menus.ToList();
//为超级管理员直接给全部路由
if (UserConst.Admin.Equals(data.User.UserName))
{
menus = await _menuRepository.GetListAsync();
}
//将后端菜单转换成前端路由,组件级别需要过滤
List<Vue3RouterDto> routers = menus.Vue3RouterBuild();
return routers;
}
/// <summary>
/// 退出登录
/// </summary>
/// <returns></returns>
public Task<bool> PostLogout()
{
return Task.FromResult(true);
}
/// <summary>
/// 生成验证码
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public CaptchaImageDto GetCaptchaImage()
{
var uuid = Guid.NewGuid();
var code = _securityCode.GetRandomEnDigitalText(4);
//将uuid与codeRedis缓存中心化保存起来登录根据uuid比对即可
//10分钟过期
//_cacheDb.Set($"Yi:Captcha:{uuid}", code, new TimeSpan(0, 10, 0));
var imgbyte = _securityCode.GetEnDigitalCodeByte(code);
return new CaptchaImageDto { Img = imgbyte, Uuid = code };
}
}
}

View File

@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Domain.Shared.School.ConstClasses
{
/// <summary>
/// 常量定义
/// </summary>
public class StudentConst
{
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -10,8 +10,12 @@
<ItemGroup>
<Compile Include="..\GlobalUsings.cs" Link="Properties\GlobalUsings.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hei.Captcha" Version="0.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\framework\Yi.Framework.Data\Yi.Framework.Data.csproj" />
<ProjectReference Include="..\..\..\module\Yi.Framework.ThumbnailSharp\Yi.Framework.ThumbnailSharp.csproj" />
<ProjectReference Include="..\Yi.RBAC.Domain.Shared\Yi.RBAC.Domain.Shared.csproj" />
</ItemGroup>

View File

@@ -1,3 +1,4 @@
using Hei.Captcha;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using StartupModules;
@@ -8,13 +9,15 @@ using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core.Attributes;
using Yi.Framework.Data;
using Yi.Framework.ThumbnailSharp;
using Yi.RBAC.Domain.Shared;
namespace Yi.RBAC.Domain
{
[DependsOn(
typeof(YiRBACDomainSharedModule),
typeof(YiFrameworkDataModule)
typeof(YiFrameworkDataModule),
typeof(YiFrameworkThumbnailSharpModule)
)]
public class YiRBACDomainModule : IStartupModule
{
@@ -24,7 +27,7 @@ namespace Yi.RBAC.Domain
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
{
//services.AddTransient<StudentManager>();
services.AddHeiCaptcha();
}
}
}

View File

@@ -22,6 +22,9 @@
<None Update="public.pem">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="yi-sqlsugar-dev.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>