feat: 添加客户端代理层

This commit is contained in:
陈淳
2024-03-20 17:52:59 +08:00
parent b6ec8cf6f0
commit f53a6cf05b
16 changed files with 300 additions and 3 deletions

View File

@@ -0,0 +1,33 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Yi.Abp.Client.Console;
using Yi.Framework.Rbac.Application.Contracts.IServices;
try
{
IHost host = Host.CreateDefaultBuilder()
.ConfigureServices(async (host, service) =>
{
await service.AddApplicationAsync<YiAbpClientConsoleModule>();
})
.UseAutofac()
.Build();
//控制台直接调用
var account = host.Services.GetRequiredService<IAccountService>();
//获取验证码
var data1 = await account.GetCaptchaImageAsync();
//登录
var data2 = await account.PostLoginAsync(new Yi.Framework.Rbac.Application.Contracts.Dtos.Account.LoginInputVo { UserName = "cc", Password = "123456", Code = string.Empty, Uuid = string.Empty });
host.Run();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}