hangfire部分;获取用户信息返回电话、邮箱、手机号

usertest
cjy 3 months ago
parent e8defab35c
commit 0c2186519d

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,43 @@
using Hangfire.Dashboard.BasicAuthorization;
using Hangfire;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.HangfireModule
{
/// <summary>
///
/// </summary>
public static class HangfireMiddleware
{
public static void UseHangfireMiddleware(this IApplicationBuilder app, IServiceCollection _services)
{
if (app == null) throw new ArgumentNullException(nameof(app));
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] {new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
{
RequireSsl = false,
SslRedirect = false,
LoginCaseSensitive = true,
Users = new []
{
new BasicAuthAuthorizationUser
{
Login = "admin",
PasswordClear = "admin"
}
}
})}
});
}
}
}

@ -0,0 +1,43 @@
namespace DS.Module.SMS;
using DS.Module.Core;
using Hangfire;
using Hangfire.HttpJob;
using Hangfire.MySql;
using Microsoft.Extensions.DependencyInjection;
using System.Transactions;
/// <summary>
/// 注入Hangfire服务
/// </summary>
public static class HangfireModuleInstall
{
/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <exception cref="ArgumentNullException"></exception>
public static void AddHangfireModuleInstall(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));
services.AddHangfire(configuration => configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseStorage(new MySqlStorage(
AppSetting.app(new string[] { "DBInfo", "HangfireDbString" }),
new MySqlStorageOptions
{
TransactionIsolationLevel = IsolationLevel.ReadCommitted,// 事务隔离级别。默认是读取已提交。
QueuePollInterval = TimeSpan.FromSeconds(15), //- 作业队列轮询间隔。默认值为15秒。
JobExpirationCheckInterval = TimeSpan.FromHours(1), //- 作业到期检查间隔管理过期记录。默认值为1小时。
CountersAggregateInterval = TimeSpan.FromMinutes(5), //- 聚合计数器的间隔。默认为5分钟。
PrepareSchemaIfNecessary = true, //- 如果设置为true则创建数据库表。默认是true。
DashboardJobListLimit = 50000,//- 仪表板作业列表限制。默认值为50000。
TransactionTimeout = TimeSpan.FromMinutes(1), //- 交易超时。默认为1分钟。
TablesPrefix = "Hangfire"
})).UseHangfireHttpJob());
}
}

@ -18,6 +18,10 @@
<PackageReference Include="fasterflect" Version="3.0.0" /> <PackageReference Include="fasterflect" Version="3.0.0" />
<PackageReference Include="GZY.Quartz.MUI" Version="2.6.0" /> <PackageReference Include="GZY.Quartz.MUI" Version="2.6.0" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.14" /> <PackageReference Include="Hangfire.AspNetCore" Version="1.8.14" />
<PackageReference Include="Hangfire.Core" Version="1.8.14" />
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
<PackageReference Include="Hangfire.HttpJob" Version="3.8.5" />
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.62" /> <PackageReference Include="HtmlAgilityPack" Version="1.11.62" />
<PackageReference Include="LanguageExt.Core" Version="4.4.7" /> <PackageReference Include="LanguageExt.Core" Version="4.4.7" />
<PackageReference Include="MailKit" Version="4.7.1.1" /> <PackageReference Include="MailKit" Version="4.7.1.1" />

@ -1,4 +1,6 @@
namespace DS.WMS.Core.Sys.Dtos; using System.ComponentModel;
namespace DS.WMS.Core.Sys.Dtos;
/// <summary> /// <summary>
/// 当前用户实体视图 /// 当前用户实体视图
@ -80,6 +82,25 @@ public class CurrentUserViewModel
/// 用户组织机构列表 /// 用户组织机构列表
/// </summary> /// </summary>
public List<UserOrgListRes> UserOrgs{ get; set; } public List<UserOrgListRes> UserOrgs{ get; set; }
/// <summary>
/// 手机
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 电话
/// </summary>
public string Tel { get; set; }
/// <summary>
/// 办公电话
/// </summary>
public string OfficePhone { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
} }
/// <summary> /// <summary>

@ -534,7 +534,11 @@ public class CommonService : ICommonService
// ClientId = a.ClientId, // ClientId = a.ClientId,
IsLimitClient = a.IsLimitClient, IsLimitClient = a.IsLimitClient,
RefreshToken = refreshToken, RefreshToken = refreshToken,
OrgId = user.GetOrgId().ToString() OrgId = user.GetOrgId().ToString(),
Tel = a.Tel,
Email = a.Email,
Phone = a.Phone,
OfficePhone = a.OfficePhone,
// UserOrgs = orgRelations, // UserOrgs = orgRelations,
//OrgId = a.OrgId.ToString(), CompanyName = a.CustomerName //OrgId = a.OrgId.ToString(), CompanyName = a.CustomerName
}) })

@ -20,6 +20,7 @@
"DefaultDbConnId": "1288018625843826688", "DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0, "DefaultDbType": 0,
"DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev", "DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev",
"HangfireDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_hangfire",
"DBS": [ "DBS": [
{ {
"ConnId": "1288018625843826680", "ConnId": "1288018625843826680",

@ -72,6 +72,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.OcrModule", "DS.M
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.ContainerManagementApi", "DS.WMS.ContainerManagementApi\DS.WMS.ContainerManagementApi.csproj", "{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.ContainerManagementApi", "DS.WMS.ContainerManagementApi\DS.WMS.ContainerManagementApi.csproj", "{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.HangfireModule", "DS.Module.HangfireModule\DS.Module.HangfireModule.csproj", "{BDF89987-3B7B-4CC6-88A9-DA4765F6FF62}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -198,6 +200,10 @@ Global
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Debug|Any CPU.Build.0 = Debug|Any CPU {7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU {7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Release|Any CPU.Build.0 = Release|Any CPU {7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Release|Any CPU.Build.0 = Release|Any CPU
{BDF89987-3B7B-4CC6-88A9-DA4765F6FF62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDF89987-3B7B-4CC6-88A9-DA4765F6FF62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDF89987-3B7B-4CC6-88A9-DA4765F6FF62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDF89987-3B7B-4CC6-88A9-DA4765F6FF62}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -233,6 +239,7 @@ Global
{274B1D18-A15A-4917-A567-6FDCD090D5B0} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {274B1D18-A15A-4917-A567-6FDCD090D5B0} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
{3EB9CA1E-5910-42A5-A64D-0CB435F6A64A} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} {3EB9CA1E-5910-42A5-A64D-0CB435F6A64A} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
{BDF89987-3B7B-4CC6-88A9-DA4765F6FF62} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788} SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}

Loading…
Cancel
Save