diff --git a/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj
index 7443bfa12..240b2809a 100644
--- a/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj
+++ b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj
@@ -22,13 +22,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj
index 24ba91acc..bbb2d6ffd 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PasswordResetDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PasswordResetDto.cs
new file mode 100644
index 000000000..a64affca6
--- /dev/null
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PasswordResetDto.cs
@@ -0,0 +1,24 @@
+using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Auditing;
+using Volo.Abp.Identity;
+
+namespace LINGYUN.Abp.Account
+{
+ public class PasswordResetDto
+ {
+ [Required]
+ [Phone]
+ [StringLength(IdentityUserConsts.MaxPhoneNumberLength)]
+ public string PhoneNumber { get; set; }
+
+ [Required]
+ [StringLength(IdentityUserConsts.MaxPasswordLength)]
+ [DataType(DataType.Password)]
+ [DisableAuditing]
+ public string NewPassword { get; set; }
+
+ [Required]
+ [StringLength(6)]
+ public string VerifyCode { get; set; }
+ }
+}
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs
index 031b76359..eee5ab984 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs
@@ -8,6 +8,8 @@ namespace LINGYUN.Abp.Account
{
Task RegisterAsync(RegisterVerifyDto input);
+ Task ResetPasswordAsync(PasswordResetDto passwordReset);
+
Task VerifyPhoneNumberAsync(VerifyDto input);
}
}
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
index 3ddea3d7a..a10c5a38b 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
@@ -6,8 +6,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs
index 0ec05b642..e73ac96ac 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs
@@ -8,6 +8,7 @@ using Volo.Abp.Caching;
using Volo.Abp.Identity;
using Volo.Abp.Settings;
using Volo.Abp.Sms;
+using Volo.Abp.Uow;
namespace LINGYUN.Abp.Account
{
@@ -18,18 +19,21 @@ namespace LINGYUN.Abp.Account
{
protected ISmsSender SmsSender { get; }
protected IdentityUserManager UserManager { get; }
+ protected IdentityUserStore UserStore { get; }
protected IIdentityUserRepository UserRepository { get; }
protected IDistributedCache Cache { get; }
protected PhoneNumberTokenProvider PhoneNumberTokenProvider { get; }
public AccountAppService(
ISmsSender smsSender,
IdentityUserManager userManager,
+ IdentityUserStore userStore,
IIdentityUserRepository userRepository,
IDistributedCache cache,
PhoneNumberTokenProvider phoneNumberTokenProvider)
{
Cache = cache;
SmsSender = smsSender;
+ UserStore = userStore;
UserManager = userManager;
UserRepository = userRepository;
PhoneNumberTokenProvider = phoneNumberTokenProvider;
@@ -57,22 +61,61 @@ namespace LINGYUN.Abp.Account
await CheckSelfRegistrationAsync();
- var userEmail = input.EmailAddress ?? input.PhoneNumber + "@abp.io";
+ // 需要用户输入邮箱?
+ //if (UserManager.Options.User.RequireUniqueEmail)
+ //{
+ // if (input.EmailAddress.IsNullOrWhiteSpace())
+ // {
+ // throw new UserFriendlyException(L["RequiredEmailAddress"]);
+ // }
+ //}
+
+ var userEmail = input.EmailAddress ?? $"{input.PhoneNumber}@{new Random().Next(1000, 99999)}.com";//如果邮件地址不验证,随意写入一个
var userName = input.UserName ?? input.PhoneNumber;
var user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id)
{
Name = input.Name ?? input.PhoneNumber
};
+ // 写入手机号要在创建用户之前,因为有一个自定义的手机号验证
+ await UserStore.SetPhoneNumberAsync(user, input.PhoneNumber);
+ await UserStore.SetPhoneNumberConfirmedAsync(user, true);
+
(await UserManager.CreateAsync(user, input.Password)).CheckErrors();
- (await UserManager.SetPhoneNumberAsync(user, input.PhoneNumber)).CheckErrors();
- (await UserManager.SetEmailAsync(user, userEmail)).CheckErrors();
(await UserManager.AddDefaultRolesAsync(user)).CheckErrors();
await Cache.RemoveAsync(phoneVerifyCacheKey);
return ObjectMapper.Map(user);
}
+
+ // TODO: 是否有必要移动到ProfileService
+ ///
+ /// 重置用户密码
+ ///
+ ///
+ ///
+ public virtual async Task ResetPasswordAsync(PasswordResetDto passwordReset)
+ {
+ // 本来可以不需要的,令牌算法有一个有效期
+ // 不过这里采用令牌强制过期策略,避免一个令牌多次使用
+ var phoneVerifyCacheKey = NormalizeCacheKey(passwordReset.PhoneNumber);
+
+ var phoneVerifyCacheItem = await Cache.GetAsync(phoneVerifyCacheKey);
+ if (phoneVerifyCacheItem == null || !phoneVerifyCacheItem.VerifyCode.Equals(passwordReset.VerifyCode))
+ {
+ throw new UserFriendlyException(L["PhoneVerifyCodeInvalid"]);
+ }
+
+ var userId = await GetUserIdByPhoneNumberAsync(passwordReset.PhoneNumber);
+
+ var user = await UserManager.GetByIdAsync(userId);
+
+ (await UserManager.ResetPasswordAsync(user, phoneVerifyCacheItem.VerifyToken, passwordReset.NewPassword)).CheckErrors();
+
+
+ await Cache.RemoveAsync(phoneVerifyCacheKey);
+ }
///
/// 验证手机号码
///
@@ -110,18 +153,26 @@ namespace LINGYUN.Abp.Account
{
PhoneNumber = input.PhoneNumber,
};
- if (input.VerifyType == PhoneNumberVerifyType.Register)
+ switch (input.VerifyType)
{
- var phoneVerifyCode = new Random().Next(100000, 999999);
- verifyCacheItem.VerifyCode = phoneVerifyCode.ToString();
- var templateCode = await SettingProvider.GetOrNullAsync(AccountSettingNames.SmsRegisterTemplateCode);
- await SendPhoneVerifyMessageAsync(templateCode, input.PhoneNumber, phoneVerifyCode.ToString());
- }
- else
- {
- var phoneVerifyCode = await SendSigninVerifyCodeAsync(input.PhoneNumber);
- verifyCacheItem.VerifyCode = phoneVerifyCode;
+ case PhoneNumberVerifyType.Register:
+ var phoneVerifyCode = new Random().Next(100000, 999999);
+ verifyCacheItem.VerifyCode = phoneVerifyCode.ToString();
+ var templateCode = await SettingProvider.GetOrNullAsync(AccountSettingNames.SmsRegisterTemplateCode);
+ await SendPhoneVerifyMessageAsync(templateCode, input.PhoneNumber, phoneVerifyCode.ToString());
+ return;
+ case PhoneNumberVerifyType.Signin:
+ var phoneSigninCode = await SendSigninVerifyCodeAsync(input.PhoneNumber);
+ verifyCacheItem.VerifyCode = phoneSigninCode;
+ break;
+ case PhoneNumberVerifyType.ResetPassword:
+ var resetPasswordCode = new Random().Next(100000, 999999);
+ verifyCacheItem.VerifyCode = resetPasswordCode.ToString();
+ var resetPasswordToken = await SendResetPasswordVerifyCodeAsync(input.PhoneNumber, verifyCacheItem.VerifyCode);
+ verifyCacheItem.VerifyToken = resetPasswordToken;
+ break;
}
+
var cacheOptions = new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(verifyCodeExpiration)
@@ -137,11 +188,7 @@ namespace LINGYUN.Abp.Account
protected virtual async Task SendSigninVerifyCodeAsync(string phoneNumber)
{
// 查找用户信息
- var user = await UserRepository.FindByPhoneNumberAsync(phoneNumber);
- if (user == null)
- {
- throw new UserFriendlyException(L["PhoneNumberNotRegisterd"]);
- }
+ var user = await GetUserByPhoneNumberAsync(phoneNumber);
// 获取登录验证码模板号
var templateCode = await SettingProvider.GetOrNullAsync(AccountSettingNames.SmsSigninTemplateCode);
// 生成手机验证码
@@ -151,6 +198,42 @@ namespace LINGYUN.Abp.Account
return phoneVerifyCode;
}
+
+ protected virtual async Task SendResetPasswordVerifyCodeAsync(string phoneNumber, string phoneVerifyCode)
+ {
+ // 查找用户信息
+ var user = await GetUserByPhoneNumberAsync(phoneNumber);
+ // 获取登录验证码模板号
+ var templateCode = await SettingProvider.GetOrNullAsync(AccountSettingNames.SmsResetPasswordTemplateCode);
+ // 生成重置密码验证码
+ var phoneVerifyToken = await UserManager.GeneratePasswordResetTokenAsync(user);
+ // 发送短信验证码
+ await SendPhoneVerifyMessageAsync(templateCode, user.PhoneNumber, phoneVerifyCode);
+
+ return phoneVerifyToken;
+ }
+
+ protected virtual async Task GetUserByPhoneNumberAsync(string phoneNumber)
+ {
+ // 查找用户信息
+ var user = await UserRepository.FindByPhoneNumberAsync(phoneNumber);
+ if (user == null)
+ {
+ throw new UserFriendlyException(L["PhoneNumberNotRegisterd"]);
+ }
+ return user;
+ }
+
+ protected virtual async Task GetUserIdByPhoneNumberAsync(string phoneNumber)
+ {
+ // 查找用户信息
+ var userId = await UserRepository.GetIdByPhoneNumberAsync(phoneNumber);
+ if (!userId.HasValue)
+ {
+ throw new UserFriendlyException(L["PhoneNumberNotRegisterd"]);
+ }
+ return userId.Value;
+ }
///
/// 检查是否允许用户注册
///
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj
index 815f27437..99e8f8e0f 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountRegisterVerifyCacheItem.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountRegisterVerifyCacheItem.cs
index faf78244a..ea74bbe66 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountRegisterVerifyCacheItem.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountRegisterVerifyCacheItem.cs
@@ -4,5 +4,6 @@
{
public string PhoneNumber { get; set; }
public string VerifyCode { get; set; }
+ public string VerifyToken { get; set; }
}
}
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountSettingNames.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountSettingNames.cs
index d3bf2abd9..b5599c281 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountSettingNames.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountSettingNames.cs
@@ -15,5 +15,9 @@
/// 用户登录短信验证码模板号
///
public const string SmsSigninTemplateCode = GroupName + ".SmsSigninTemplateCode";
+ ///
+ /// 用户重置密码短信验证码模板号
+ ///
+ public const string SmsResetPasswordTemplateCode = GroupName + ".SmsResetPasswordTemplateCode";
}
}
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/PhoneNumberVerifyType.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/PhoneNumberVerifyType.cs
index 3fb05ebcd..4c01f3b55 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/PhoneNumberVerifyType.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/PhoneNumberVerifyType.cs
@@ -3,6 +3,7 @@
public enum PhoneNumberVerifyType : sbyte
{
Register = 0,
- Signin = 10
+ Signin = 10,
+ ResetPassword = 20
}
}
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
index 74d1df10d..b34fbca1d 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountDomainModule.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountDomainModule.cs
index 0ad58c817..38693428c 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountDomainModule.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountDomainModule.cs
@@ -1,4 +1,5 @@
-using Volo.Abp.Localization;
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountSettingDefinitionProvider.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountSettingDefinitionProvider.cs
index b8f347730..5ea113e60 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountSettingDefinitionProvider.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/AbpAccountSettingDefinitionProvider.cs
@@ -20,6 +20,8 @@ namespace LINGYUN.Abp.Account
"SMS_190728520", L("DisplayName:SmsRegisterTemplateCode"), L("Description:SmsRegisterTemplateCode")),
new SettingDefinition(AccountSettingNames.SmsSigninTemplateCode,
"SMS_190728516", L("DisplayName:SmsSigninTemplateCode"), L("Description:SmsSigninTemplateCode")),
+ new SettingDefinition(AccountSettingNames.SmsResetPasswordTemplateCode,
+ "SMS_192530831", L("DisplayName:SmsResetPasswordTemplateCode"), L("Description:SmsResetPasswordTemplateCode")),
new SettingDefinition(AccountSettingNames.PhoneVerifyCodeExpiration,
"3", L("DisplayName:PhoneVerifyCodeExpiration"), L("Description:PhoneVerifyCodeExpiration")),
};
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/IIdentityUserRepository.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/IIdentityUserRepository.cs
index 54817fc92..360c2f22b 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/IIdentityUserRepository.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/IIdentityUserRepository.cs
@@ -7,6 +7,10 @@ namespace LINGYUN.Abp.Account
{
public interface IIdentityUserRepository : IReadOnlyRepository
{
+ Task PhoneNumberHasRegistedAsync(string phoneNumber);
+
Task FindByPhoneNumberAsync(string phoneNumber);
+
+ Task GetIdByPhoneNumberAsync(string phoneNumber);
}
}
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/en.json b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/en.json
index 488ddc52f..d94881919 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/en.json
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/en.json
@@ -8,7 +8,12 @@
"Description:SmsRegisterTemplateCode": "When the user registers, he/she should send the template number of the SMS verification code and fill in the template number of the corresponding cloud platform registration",
"DisplayName:SmsSigninTemplateCode": "Signin sms template",
"Description:SmsSigninTemplateCode": "When the user logs in, he/she should send the template number of the SMS verification code and fill in the template number of the corresponding cloud platform registration",
+ "DisplayName:SmsResetPasswordTemplateCode": "Reset password sms template",
+ "Description:SmsResetPasswordTemplateCode": "When the user resets the password, he/she sends the template number of SMS verification code and fills in the template number registered on the cloud platform",
"DisplayName:PhoneVerifyCodeExpiration": "SMS verification code validity",
- "Description:PhoneVerifyCodeExpiration": "The valid time for the user to send SMS verification code, unit m, default 3m"
+ "Description:PhoneVerifyCodeExpiration": "The valid time for the user to send SMS verification code, unit m, default 3m",
+ "RequiredEmailAddress": "Email address required",
+ "InvalidPhoneNumber": "Invalid phone number",
+ "DuplicatePhoneNumber": "The phone number {0} has been registered!"
}
}
\ No newline at end of file
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json
index 479cf69fa..114e36d31 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json
@@ -8,7 +8,12 @@
"Description:SmsRegisterTemplateCode": "用户注册时发送短信验证码的模板号,填写对应云平台注册的模板号",
"DisplayName:SmsSigninTemplateCode": "用户登录短信模板",
"Description:SmsSigninTemplateCode": "用户登录时发送短信验证码的模板号,填写对应云平台注册的模板号",
+ "DisplayName:SmsResetPasswordTemplateCode": "用户重置密码短信模板",
+ "Description:SmsResetPasswordTemplateCode": "用户重置密码时发送短信验证码的模板号,填写对应云平台注册的模板号",
"DisplayName:PhoneVerifyCodeExpiration": "短信验证码有效期",
- "Description:PhoneVerifyCodeExpiration": "用户发送短信验证码的有效时长,单位m,默认3m"
+ "Description:PhoneVerifyCodeExpiration": "用户发送短信验证码的有效时长,单位m,默认3m",
+ "RequiredEmailAddress": "邮件地址必须输入",
+ "InvalidPhoneNumber": "手机号无效",
+ "DuplicatePhoneNumber": "手机号已经注册过!"
}
}
\ No newline at end of file
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/Microsoft/AspNetCore/Identity/PhoneNumberUserValidator.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/Microsoft/AspNetCore/Identity/PhoneNumberUserValidator.cs
new file mode 100644
index 000000000..861de3343
--- /dev/null
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/Microsoft/AspNetCore/Identity/PhoneNumberUserValidator.cs
@@ -0,0 +1,48 @@
+using LINGYUN.Abp.Account.Localization;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Localization;
+using System;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.Identity;
+using IIdentityUserRepository = LINGYUN.Abp.Account.IIdentityUserRepository;
+
+namespace Microsoft.AspNetCore.Identity
+{
+ [Dependency(ServiceLifetime.Scoped, ReplaceServices = true)]
+ [ExposeServices(typeof(IUserValidator))]
+ public class PhoneNumberUserValidator : UserValidator
+ {
+ private readonly IStringLocalizer _stringLocalizer;
+ private readonly IIdentityUserRepository _identityUserRepository;
+
+ public PhoneNumberUserValidator(
+ IStringLocalizer stringLocalizer,
+ IIdentityUserRepository identityUserRepository)
+ {
+ _stringLocalizer = stringLocalizer;
+ _identityUserRepository = identityUserRepository;
+ }
+ public override async Task ValidateAsync(UserManager manager, IdentityUser user)
+ {
+ await ValidatePhoneNumberAsync(manager, user);
+ return await base.ValidateAsync(manager, user);
+ }
+
+ protected virtual async Task ValidatePhoneNumberAsync(UserManager manager, IdentityUser user)
+ {
+ var phoneNumber = await manager.GetPhoneNumberAsync(user);
+ if (phoneNumber.IsNullOrWhiteSpace())
+ {
+ throw new UserFriendlyException(_stringLocalizer["InvalidPhoneNumber"].Value, "InvalidPhoneNumber");
+ }
+
+ var phoneNumberHasRegisted = await _identityUserRepository.PhoneNumberHasRegistedAsync(phoneNumber);
+ if (phoneNumberHasRegisted)
+ {
+ throw new UserFriendlyException(_stringLocalizer["DuplicatePhoneNumber", phoneNumber].Value, "DuplicatePhoneNumber");
+ }
+ }
+ }
+}
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj
index b2242b858..6725c1982 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs
index f1cc98255..af5b83b4a 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs
@@ -32,5 +32,12 @@ namespace LINGYUN.Abp.Account
{
await AccountAppService.VerifyPhoneNumberAsync(input);
}
+
+ [HttpPut]
+ [Route("reset-password")]
+ public virtual async Task ResetPasswordAsync(PasswordResetDto passwordReset)
+ {
+ await AccountAppService.ResetPasswordAsync(passwordReset);
+ }
}
}
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj
index a66598500..24a4fe1a7 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj
index e87e99db2..acb418ada 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj
index f6eb8b1c0..9e3de3ff0 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
index 72e481122..13ed4360f 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
@@ -7,8 +7,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj
index ab90b85d8..3a6c97777 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj
index 9239a7892..684658912 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj
index a9dc687be..fc07ebac2 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock/LINGYUN.Abp.DistributedLock.csproj b/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock/LINGYUN.Abp.DistributedLock.csproj
index 9115b80b6..e5287dda7 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock/LINGYUN.Abp.DistributedLock.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock/LINGYUN.Abp.DistributedLock.csproj
@@ -3,6 +3,13 @@
netstandard2.0
+ false
+ true
+ 2.9.0
+
+
+
+ D:\LocalNuget
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj
index 86262fec0..1087610d0 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj
@@ -5,7 +5,7 @@
true
false
- 2.8.0
+ 2.9.0
Cap分布式事件总线
@@ -16,8 +16,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN.Abp.FileStorage.Qiniu.csproj b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN.Abp.FileStorage.Qiniu.csproj
new file mode 100644
index 000000000..7a4dbebec
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN.Abp.FileStorage.Qiniu.csproj
@@ -0,0 +1,20 @@
+
+
+
+ netstandard2.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/AbpQiniuFileStorageModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/AbpQiniuFileStorageModule.cs
new file mode 100644
index 000000000..2568f6cd5
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/AbpQiniuFileStorageModule.cs
@@ -0,0 +1,10 @@
+using Volo.Abp.Modularity;
+
+namespace LINGYUN.Abp.FileStorage.Qiniu
+{
+ [DependsOn(typeof(AbpFileStorageModule))]
+ public class AbpQiniuFileStorageModule : AbpModule
+ {
+
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/QiniuFileStorageOptions.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/QiniuFileStorageOptions.cs
new file mode 100644
index 000000000..7a7838a0b
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/QiniuFileStorageOptions.cs
@@ -0,0 +1,40 @@
+namespace LINGYUN.Abp.FileStorage.Qiniu
+{
+ public class QiniuFileStorageOptions
+ {
+ ///
+ /// Api授权码
+ ///
+ public string AccessKey { get; set; }
+ ///
+ /// Api密钥
+ ///
+ public string SecretKey { get; set; }
+ ///
+ /// 默认自动删除该文件天数
+ /// 默认 0,不删除
+ ///
+ public int DeleteAfterDays { get; set; }
+ ///
+ /// 上传成功后,七牛云向业务服务器发送 POST 请求的 URL。
+ /// 必须是公网上可以正常进行 POST 请求并能响应 HTTP/1.1 200 OK 的有效 URL
+ ///
+ public string UploadCallbackUrl { get; set; }
+ ///
+ /// 上传成功后,七牛云向业务服务器发送回调通知时的 Host 值。
+ /// 与 callbackUrl 配合使用,仅当设置了 callbackUrl 时才有效。
+ ///
+ public string UploadCallbackHost { get; set; }
+ ///
+ /// 上传成功后,七牛云向业务服务器发送回调通知 callbackBody 的 Content-Type。
+ /// 默认为 application/x-www-form-urlencoded,也可设置为 application/json。
+ ///
+ public string UploadCallbackBodyType { get; set; }
+ ///
+ /// 上传成功后,自定义七牛云最终返回給上传端(在指定 returnUrl 时是携带在跳转路径参数中)的数据。
+ /// 支持魔法变量和自定义变量。returnBody 要求是合法的 JSON 文本。
+ /// 例如 {"key": $(key), "hash": $(etag), "w": $(imageInfo.width), "h": $(imageInfo.height)}。
+ ///
+ public string UploadCallbackBody { get; set; }
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/QiniuFileStorageProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/QiniuFileStorageProvider.cs
new file mode 100644
index 000000000..2a19b2d4e
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage.Qiniu/LINGYUN/Abp/FileStorage/Qiniu/QiniuFileStorageProvider.cs
@@ -0,0 +1,111 @@
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
+using Qiniu.IO;
+using Qiniu.IO.Model;
+using Qiniu.RS;
+using Qiniu.Util;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using Volo.Abp.DependencyInjection;
+
+namespace LINGYUN.Abp.FileStorage.Qiniu
+{
+ [Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
+ [ExposeServices(typeof(IFileStorageProvider), typeof(FileStorageProvider))]
+ public class QiniuFileStorageProvider : FileStorageProvider
+ {
+ protected QiniuFileStorageOptions Options { get; }
+ public QiniuFileStorageProvider(
+ IFileStore store,
+ IOptions options)
+ : base(store)
+ {
+ Options = options.Value;
+ }
+
+ protected override async Task DownloadFileAsync(FileInfo fileInfo, string saveLocalPath)
+ {
+ Mac mac = new Mac(Options.AccessKey, Options.SecretKey);
+
+ int expireInSeconds = 3600;
+ string accUrl = DownloadManager.CreateSignedUrl(mac, fileInfo.Url, expireInSeconds);
+
+ var saveLocalFile = Path.Combine(saveLocalPath, fileInfo.Name);
+ var httpResult = await DownloadManager.DownloadAsync(accUrl, saveLocalFile);
+ if(httpResult.Code == 200)
+ {
+ using (var fs = new FileStream(saveLocalFile, FileMode.Open, FileAccess.Read))
+ {
+ fileInfo.Data = new byte[fs.Length];
+
+ await fs.ReadAsync(fileInfo.Data, 0, fileInfo.Data.Length).ConfigureAwait(false);
+ }
+ }
+ else
+ {
+ // TODO: 处理响应代码
+
+ Console.WriteLine(httpResult.Code);
+ }
+
+ return fileInfo;
+ }
+
+ protected override async Task RemoveFileAsync(FileInfo fileInfo, CancellationToken cancellationToken = default)
+ {
+ Mac mac = new Mac(Options.AccessKey, Options.SecretKey);
+
+ var bucket = fileInfo.Directory + ":" + fileInfo.Name;
+ var backetManager = new BucketManager(mac);
+ await backetManager.DeleteAsync(bucket, fileInfo.Name);
+
+ throw new NotImplementedException();
+ }
+
+ protected override async Task UploadFileAsync(FileInfo fileInfo, int? expireIn = null, CancellationToken cancellationToken = default)
+ {
+ Mac mac = new Mac(Options.AccessKey, Options.SecretKey);
+
+ PutPolicy putPolicy = new PutPolicy
+ {
+ Scope = fileInfo.Directory + ":" + fileInfo.Name,
+ CallbackBody = Options.UploadCallbackBody,
+ CallbackBodyType = Options.UploadCallbackBodyType,
+ CallbackHost = Options.UploadCallbackHost,
+ CallbackUrl = Options.UploadCallbackUrl
+ };
+ if (expireIn.HasValue)
+ {
+ putPolicy.SetExpires(expireIn.Value);
+ }
+ if (Options.DeleteAfterDays > 0)
+ {
+ putPolicy.DeleteAfterDays = Options.DeleteAfterDays;
+ }
+
+
+ string jstr = putPolicy.ToJsonString();
+ string token = Auth.CreateUploadToken(mac, jstr);
+
+ UploadProgressHandler handler = (uploadByte, totalByte) =>
+ {
+ OnFileUploadProgressChanged(uploadByte, totalByte);
+ };
+
+ // 带进度的上传
+ ResumableUploader uploader = new ResumableUploader();
+ var httpResult = await uploader.UploadDataAsync(fileInfo.Data, fileInfo.Name, token, handler);
+
+ // 普通上传
+ //FormUploader fu = new FormUploader();
+ //var httpResult = await fu.UploadDataAsync(fileInfo.Data, fileInfo.Name, token);
+
+ // TODO: 处理响应代码
+
+ Console.WriteLine(httpResult.Code);
+ }
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN.Abp.FileStorage.csproj b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN.Abp.FileStorage.csproj
new file mode 100644
index 000000000..248eb0396
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN.Abp.FileStorage.csproj
@@ -0,0 +1,12 @@
+
+
+
+ netstandard2.0
+
+
+
+
+
+
+
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/AbpFileStorageModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/AbpFileStorageModule.cs
new file mode 100644
index 000000000..57147498e
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/AbpFileStorageModule.cs
@@ -0,0 +1,8 @@
+using Volo.Abp.Modularity;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ public class AbpFileStorageModule : AbpModule
+ {
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileDownloadCompletedEventArges.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileDownloadCompletedEventArges.cs
new file mode 100644
index 000000000..8d41bafa5
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileDownloadCompletedEventArges.cs
@@ -0,0 +1,8 @@
+using System;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ public class FileDownloadCompletedEventArges : EventArgs
+ {
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileDownloadProgressEventArges.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileDownloadProgressEventArges.cs
new file mode 100644
index 000000000..d254b4461
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileDownloadProgressEventArges.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ public class FileDownloadProgressEventArges : EventArgs
+ {
+
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileInfo.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileInfo.cs
new file mode 100644
index 000000000..7376e7297
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileInfo.cs
@@ -0,0 +1,59 @@
+using System;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ ///
+ /// 文件信息
+ ///
+ public class FileInfo
+ {
+ ///
+ /// 名称
+ ///
+ public string Name { get; set; }
+ ///
+ /// 大小
+ ///
+ public long Size { get; set; }
+ ///
+ /// 文件路径
+ ///
+ public string Directory { get; set; }
+ ///
+ /// 文件扩展名
+ ///
+ public string Extension { get; set; }
+ ///
+ /// 文件哈希码,用于唯一标识
+ ///
+ public string Hash { get; set; }
+ ///
+ /// 文件链接
+ ///
+ public string Url { get; set; }
+ ///
+ /// 文件数据
+ ///
+ public byte[] Data { get; set; }
+ ///
+ /// 媒体类型
+ ///
+ public MediaType MediaType { get; set; }
+ ///
+ /// 创建时间
+ ///
+ public DateTime CreationTime { get; set; }
+ ///
+ /// 创建人
+ ///
+ public Guid? CreatorId { get; set; }
+ ///
+ /// 上次变更时间
+ ///
+ public DateTime? LastModificationTime { get; set; }
+ ///
+ /// 上次变更人
+ ///
+ public Guid? LastModifierId { get; set; }
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileStorageProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileStorageProvider.cs
new file mode 100644
index 000000000..57d33ca5e
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileStorageProvider.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ public abstract class FileStorageProvider : IFileStorageProvider
+ {
+ public event EventHandler FileDownloadProgressChanged;
+ public event EventHandler FileDownloadCompleted;
+ public event EventHandler FileUploadProgressChanged;
+ public event EventHandler FileUploadCompleted;
+
+ protected IFileStore Store { get; }
+
+ public FileStorageProvider(IFileStore store)
+ {
+ Store = store;
+ }
+
+ public async Task DeleteFileAsync(string hash, CancellationToken cancellationToken = default)
+ {
+ // 获取文件信息
+ var file = await Store.GetFileAsync(hash);
+ // 删除文件
+ await RemoveFileAsync(file, cancellationToken);
+ // 删除文件信息
+ await Store.DeleteFileAsync(hash, cancellationToken);
+ }
+
+ public async Task GetFileAsync(string hash, string saveLocalPath)
+ {
+ // 获取文件信息
+ var file = await Store.GetFileAsync(hash);
+ // 下载文件
+ return await DownloadFileAsync(file, saveLocalPath);
+ }
+
+ public async Task StorageAsync(FileInfo fileInfo, int? expireIn = null, CancellationToken cancellationToken = default)
+ {
+ // step1 上传文件
+ await UploadFileAsync(fileInfo, expireIn, cancellationToken);
+ // step2 保存文件信息
+ await Store.StorageAsync(fileInfo, expireIn, cancellationToken);
+ }
+
+ protected abstract Task UploadFileAsync(FileInfo fileInfo, int? expireIn = null, CancellationToken cancellationToken = default);
+
+ protected abstract Task DownloadFileAsync(FileInfo fileInfo, string saveLocalPath);
+
+ protected abstract Task RemoveFileAsync(FileInfo fileInfo, CancellationToken cancellationToken = default);
+
+ protected virtual void OnFileUploadProgressChanged(long sent, long total)
+ {
+ FileUploadProgressChanged?.Invoke(this, new FileUploadProgressEventArges(sent, total));
+ }
+
+ protected virtual void OnFileUploadConpleted()
+ {
+ FileUploadCompleted?.Invoke(this, new FileUploadCompletedEventArges());
+ }
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileUploadCompletedEventArges.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileUploadCompletedEventArges.cs
new file mode 100644
index 000000000..eb23f111d
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileUploadCompletedEventArges.cs
@@ -0,0 +1,8 @@
+using System;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ public class FileUploadCompletedEventArges : EventArgs
+ {
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileUploadProgressEventArges.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileUploadProgressEventArges.cs
new file mode 100644
index 000000000..9ae7def26
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/FileUploadProgressEventArges.cs
@@ -0,0 +1,21 @@
+using System;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ public class FileUploadProgressEventArges : EventArgs
+ {
+ ///
+ /// 上传数据大小
+ ///
+ public long BytesSent { get; }
+ ///
+ /// 总数据大小
+ ///
+ public long TotalBytesSent { get; }
+ public FileUploadProgressEventArges(long sent, long total)
+ {
+ BytesSent = sent;
+ TotalBytesSent = total;
+ }
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/IFileStorageProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/IFileStorageProvider.cs
new file mode 100644
index 000000000..b7c892b45
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/IFileStorageProvider.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ ///
+ /// 文件存储提供者
+ ///
+ public interface IFileStorageProvider
+ {
+ event EventHandler FileDownloadProgressChanged;
+ event EventHandler FileDownloadCompleted;
+
+ event EventHandler FileUploadProgressChanged;
+ event EventHandler FileUploadCompleted;
+
+ ///
+ /// 存储文件
+ ///
+ /// 文件信息
+ /// 过期时间,单位(s)
+ ///
+ ///
+ Task StorageAsync(FileInfo fileInfo, int? expireIn = null, CancellationToken cancellationToken = default);
+ ///
+ /// 获取文件
+ ///
+ /// 文件唯一标识
+ /// 保存到本地路径
+ ///
+ Task GetFileAsync(string hash, string saveLocalPath);
+ ///
+ /// 删除文件
+ ///
+ /// 文件唯一标识
+ ///
+ ///
+ Task DeleteFileAsync(string hash, CancellationToken cancellationToken = default);
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/IFileStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/IFileStore.cs
new file mode 100644
index 000000000..f4b12a87b
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/IFileStore.cs
@@ -0,0 +1,39 @@
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace LINGYUN.Abp.FileStorage
+{
+ ///
+ /// 文件存储接口
+ ///
+ public interface IFileStore
+ {
+ ///
+ /// 存储文件
+ ///
+ /// 文件信息
+ /// 过期时间,单位(s)
+ ///
+ ///
+ Task StorageAsync(FileInfo fileInfo, int? expireIn = null, CancellationToken cancellationToken = default);
+ ///
+ /// 获取文件
+ ///
+ /// 文件唯一标识
+ ///
+ Task GetFileAsync(string hash);
+ ///
+ /// 文件是否存在
+ ///
+ /// 文件唯一标识
+ ///
+ Task FileHasExistsAsync(string hash);
+ ///
+ /// 删除文件
+ ///
+ /// 文件唯一标识
+ ///
+ ///
+ Task DeleteFileAsync(string hash, CancellationToken cancellationToken = default);
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/MediaType.cs b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/MediaType.cs
new file mode 100644
index 000000000..ebabe6fda
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.FileStorage/LINGYUN/Abp/FileStorage/MediaType.cs
@@ -0,0 +1,25 @@
+namespace LINGYUN.Abp.FileStorage
+{
+ ///
+ /// 媒体类型
+ ///
+ public enum MediaType
+ {
+ ///
+ /// 文档
+ ///
+ Document = 0,
+ ///
+ /// 图像
+ ///
+ Image = 2,
+ ///
+ /// 影像
+ ///
+ Video = 3,
+ ///
+ /// 音乐
+ ///
+ Music = 4
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj
index 7718a5418..ec878f1a4 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj
@@ -3,10 +3,16 @@
netcoreapp3.1
+ true
+ 2.9.0
+
+
+
+ D:\LocalNuget
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessageHub.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessageHub.cs
index 75b05f35e..cf47eeaa5 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessageHub.cs
+++ b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessageHub.cs
@@ -65,6 +65,12 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
{
var onlineClientContext = new OnlineClientContext(chatMessage.TenantId, chatMessage.ToUserId.GetValueOrDefault());
var onlineClients = OnlineClientManager.GetAllByContext(onlineClientContext);
+
+ // 需要捕捉每一个发送任务的异常吗?
+ // var onlineClientConnections = onlineClients.Select(c => c.ConnectionId).ToImmutableList();
+ // var signalRClient = Clients.Clients(onlineClientConnections);
+ // await signalRClient.SendAsync("getChatMessage", chatMessage);
+
foreach (var onlineClient in onlineClients)
{
try
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj
index db4635ca9..a6e3faca2 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj
@@ -1,12 +1,18 @@
-
+
netstandard2.0
+ true
+ 2.9.0
+
+
+
+ D:\LocalNuget
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Identity.OverrideOptions/LINGYUN.Abp.Identity.OverrideOptions.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Identity.OverrideOptions/LINGYUN.Abp.Identity.OverrideOptions.csproj
index 5260b1752..0e9f60648 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.Identity.OverrideOptions/LINGYUN.Abp.Identity.OverrideOptions.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.Identity.OverrideOptions/LINGYUN.Abp.Identity.OverrideOptions.csproj
@@ -3,10 +3,16 @@
netstandard2.0
+ true
+ 2.9.0
+
+
+
+ D:\LocalNuget
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/Class1.cs b/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/Class1.cs
new file mode 100644
index 000000000..ea63efae8
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/Class1.cs
@@ -0,0 +1,8 @@
+using System;
+
+namespace LINGYUN.Abp.IdentityServer.WeChatValidator
+{
+ public class Class1
+ {
+ }
+}
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN.Abp.IdentityServer.WeChatValidator.csproj b/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN.Abp.IdentityServer.WeChatValidator.csproj
new file mode 100644
index 000000000..c15204a42
--- /dev/null
+++ b/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN.Abp.IdentityServer.WeChatValidator.csproj
@@ -0,0 +1,12 @@
+
+
+
+ netcoreapp3.1
+
+
+
+
+
+
+
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj
index 7296996eb..277add8ca 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj
@@ -4,7 +4,7 @@
netstandard2.0
false
- 2.8.0
+ 2.9.0
百度位置服务
true
@@ -25,9 +25,9 @@
-
-
-
+
+
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj
index b2ee23223..c09b27d58 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj
@@ -4,7 +4,7 @@
netstandard2.0
true
- 2.8.0
+ 2.9.0
位置服务
false
@@ -14,7 +14,7 @@
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj
index 1d4d15feb..96d5e3069 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj
@@ -3,11 +3,17 @@
netcoreapp3.1
+ true
+ 2.9.0
+
+
+
+ D:\LocalNuget
-
-
+
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj
index 60d5efeb9..a6f38bfc2 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj
@@ -3,10 +3,17 @@
netstandard2.0
+ false
+ true
+ 2.9.0
+
+
+
+ D:\LocalNuget
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj
index 268dae169..25dfe142c 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj
@@ -3,10 +3,16 @@
netstandard2.0
+ 2.9.0
+ true
+
+
+
+ D:\LocalNuget
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RedisLock/LINGYUN.Abp.RedisLock.csproj b/aspnet-core/modules/common/LINGYUN.Abp.RedisLock/LINGYUN.Abp.RedisLock.csproj
index b9df59cc8..cf62619e3 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.RedisLock/LINGYUN.Abp.RedisLock.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.RedisLock/LINGYUN.Abp.RedisLock.csproj
@@ -3,13 +3,19 @@
netstandard2.0
+ true
+ 2.9.0
+
+
+
+ D:\LocalNuget
-
+
diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj
index 5e43f4810..8c6bc0335 100644
--- a/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj
@@ -4,7 +4,7 @@
netstandard2.0
false
- 2.8.0
+ 2.9.0
阿里云短信服务
true
@@ -25,9 +25,9 @@
-
-
-
+
+
+
diff --git a/aspnet-core/modules/common/LINGYUN.Common.EventBus/LINGYUN.Common.EventBus.csproj b/aspnet-core/modules/common/LINGYUN.Common.EventBus/LINGYUN.Common.EventBus.csproj
index 7b0206dd6..44af410ff 100644
--- a/aspnet-core/modules/common/LINGYUN.Common.EventBus/LINGYUN.Common.EventBus.csproj
+++ b/aspnet-core/modules/common/LINGYUN.Common.EventBus/LINGYUN.Common.EventBus.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj
index 0e784b770..fc3f707e6 100644
--- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj
+++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj
@@ -16,8 +16,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedInputDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedInputDto.cs
index 0f5629048..1205c96f3 100644
--- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedInputDto.cs
+++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedInputDto.cs
@@ -4,5 +4,6 @@ namespace LINGYUN.Abp.IdentityServer.Clients
{
public class ClientGetByPagedInputDto : PagedAndSortedResultRequestDto
{
+ public string Filter { get; set; }
}
}
diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj
index 86577be15..eac54b786 100644
--- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj
+++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs
index 455c83798..091c9988a 100644
--- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs
+++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs
@@ -141,7 +141,8 @@ namespace LINGYUN.Abp.IdentityServer.Clients
{
// Abp官方IdentityServer项目不支持Filter过滤...
var clients = await ClientRepository.GetListAsync(clientGetByPaged.Sorting,
- clientGetByPaged.SkipCount, clientGetByPaged.MaxResultCount, true);
+ clientGetByPaged.SkipCount, clientGetByPaged.MaxResultCount,
+ clientGetByPaged.Filter, true);
var clientCount = await ClientRepository.GetCountAsync();
diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs
index 30ffec299..fa444fd4e 100644
--- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs
+++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs
@@ -28,7 +28,8 @@ namespace LINGYUN.Abp.IdentityServer.IdentityResources
public virtual async Task> GetAsync(IdentityResourceGetByPagedInputDto identityResourceGetByPaged)
{
var identityResources = await IdentityResourceRepository.GetListAsync(identityResourceGetByPaged.Sorting,
- identityResourceGetByPaged.SkipCount, identityResourceGetByPaged.MaxResultCount, true);
+ identityResourceGetByPaged.SkipCount, identityResourceGetByPaged.MaxResultCount,
+ identityResourceGetByPaged.Filter, true);
var identityResourceCount = await IdentityResourceRepository.GetCountAsync();
return new PagedResultDto(identityResourceCount,
diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj
index 9c4eafc5c..24db66037 100644
--- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj
+++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj
index e79d7fe1b..9eb0d5c96 100644
--- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj
+++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj
index 799cfdfd1..71e468153 100644
--- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj
+++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj
index 30ef08749..8ae03890c 100644
--- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj
+++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj
@@ -16,10 +16,10 @@
-
-
-
-
+
+
+
+
diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs
index 6bea621c6..0b2cb061e 100644
--- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs
+++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs
@@ -44,26 +44,29 @@ namespace LINGYUN.Abp.MessageService.EventBus
{
// 获取默认语言
var userDefaultCultureName = await _settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);
- if (!userDefaultCultureName.IsNullOrWhiteSpace())
+ if (userDefaultCultureName.IsNullOrWhiteSpace())
{
- CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo(userDefaultCultureName);
+ userDefaultCultureName = CultureInfo.CurrentUICulture.Name;
// CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(userDefaultCultureName);
}
- // 订阅用户欢迎消息
- await _notificationStore.InsertUserSubscriptionAsync(eventData.Entity.TenantId,
- eventData.Entity.Id, UserNotificationNames.WelcomeToApplication);
-
- var userWelcomeNotifiction = new NotificationInfo
+ using (CultureHelper.Use(userDefaultCultureName, userDefaultCultureName))
{
- CreationTime = DateTime.Now,
- Name = UserNotificationNames.WelcomeToApplication,
- NotificationSeverity = NotificationSeverity.Info,
- NotificationType = NotificationType.System,
- TenantId = eventData.Entity.TenantId
- };
- userWelcomeNotifiction.Data.Properties["message"] = L("WelcomeToApplicationFormUser", eventData.Entity.UserName);
+ // 订阅用户欢迎消息
+ await _notificationStore.InsertUserSubscriptionAsync(eventData.Entity.TenantId,
+ eventData.Entity.Id, UserNotificationNames.WelcomeToApplication);
+
+ var userWelcomeNotifiction = new NotificationInfo
+ {
+ CreationTime = DateTime.Now,
+ Name = UserNotificationNames.WelcomeToApplication,
+ NotificationSeverity = NotificationSeverity.Info,
+ NotificationType = NotificationType.System,
+ TenantId = eventData.Entity.TenantId
+ };
+ userWelcomeNotifiction.Data.Properties["message"] = L("WelcomeToApplicationFormUser", eventData.Entity.UserName);
- await _notificationDispatcher.DispatcheAsync(userWelcomeNotifiction);
+ await _notificationDispatcher.DispatcheAsync(userWelcomeNotifiction);
+ }
}
//public async Task HandleEventAsync(EntityCreatedEventData eventData)
diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj
index 3ce788c0a..f2ad8207b 100644
--- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj
+++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj
index fd6a1743a..40cfdbeb3 100644
--- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj
+++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj b/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj
index e904bdfa4..05b157138 100644
--- a/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj
+++ b/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj
@@ -6,8 +6,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj b/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj
index 1485e2519..0230360fb 100644
--- a/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj
+++ b/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj
@@ -6,8 +6,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj
index 15a6eb018..baf88ac49 100644
--- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj
+++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj
@@ -16,8 +16,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj
index a4667a898..1554fb551 100644
--- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj
+++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj
index 5dba8495c..439c131aa 100644
--- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj
+++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj
index 77e7ab38d..0cac8b4d5 100644
--- a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj
+++ b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj
@@ -6,8 +6,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj
index 447d25c85..1a8b4c03b 100644
--- a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj
+++ b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj
index 2a0839fe6..ea4bb4399 100644
--- a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj
+++ b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj b/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj
index c23a9923f..2443966f8 100644
--- a/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj
+++ b/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj
@@ -20,15 +20,15 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs b/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs
index 62593211a..69727933e 100644
--- a/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs
+++ b/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs
@@ -19,10 +19,24 @@ namespace AuthServer.Host.EntityFrameworkCore.Identity
{
}
- public async Task FindByPhoneNumberAsync(string phoneNumber)
+ public virtual async Task PhoneNumberHasRegistedAsync(string phoneNumber)
+ {
+ return await DbSet.AnyAsync(x => x.PhoneNumberConfirmed && x.PhoneNumber.Equals(phoneNumber));
+ }
+
+ public virtual async Task GetIdByPhoneNumberAsync(string phoneNumber)
+ {
+ return await DbSet
+ .Where(x => x.PhoneNumber.Equals(phoneNumber))
+ .Select(x => x.Id)
+ .FirstOrDefaultAsync();
+ }
+
+ public virtual async Task FindByPhoneNumberAsync(string phoneNumber)
{
return await WithDetails()
.Where(usr => usr.PhoneNumber.Equals(phoneNumber))
+ .AsNoTracking()
.FirstOrDefaultAsync();
}
diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj
index 9578d5f3b..69f88f285 100644
--- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj
+++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj
@@ -17,10 +17,10 @@
-
-
-
-
+
+
+
+
diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj
index a0ab01d18..572a7f95e 100644
--- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj
+++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj
@@ -28,11 +28,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/aspnet-core/services/cleanup-logs.bat b/aspnet-core/services/cleanup-logs.bat
index 56d1f3d39..6375621d7 100644
--- a/aspnet-core/services/cleanup-logs.bat
+++ b/aspnet-core/services/cleanup-logs.bat
@@ -2,7 +2,10 @@
cls
chcp 65001
-echo. 启动平台管理服务
+echo. 清理所有服务日志
-cd .\platform\LINGYUN.Platform.HttpApi.Host
+del .\platform\LINGYUN.Platform.HttpApi.Host\Logs /y
+del .\apigateway\LINGYUN.ApiGateway.Host\Logs /y
+del .\apigateway\LINGYUN.ApiGateway.HttpApi.Host\Logs /y
+del .\account\AuthServer.Host\Logs /y
diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs
index 7809d6795..c9fd962c4 100644
--- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs
+++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/Identity/EfCoreIdentityUserExtensionRepository.cs
@@ -19,9 +19,24 @@ namespace LINGYUN.Platform.EntityFrameworkCore.Identity
{
}
- public async Task FindByPhoneNumberAsync(string phoneNumber)
+ public virtual async Task PhoneNumberHasRegistedAsync(string phoneNumber)
{
- return await DbSet.Where(usr => usr.PhoneNumber.Equals(phoneNumber)).FirstOrDefaultAsync();
+ return await DbSet.AnyAsync(x => x.PhoneNumberConfirmed && x.PhoneNumber.Equals(phoneNumber));
+ }
+
+ public virtual async Task GetIdByPhoneNumberAsync(string phoneNumber)
+ {
+ return await DbSet
+ .Where(x => x.PhoneNumber.Equals(phoneNumber))
+ .Select(x => x.Id)
+ .FirstOrDefaultAsync();
+ }
+
+ public virtual async Task FindByPhoneNumberAsync(string phoneNumber)
+ {
+ return await DbSet.Where(usr => usr.PhoneNumber.Equals(phoneNumber))
+ .AsNoTracking()
+ .FirstOrDefaultAsync();
}
}
}
diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContext.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContext.cs
new file mode 100644
index 000000000..8c7382a55
--- /dev/null
+++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContext.cs
@@ -0,0 +1,35 @@
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore;
+using Volo.Abp.Identity.EntityFrameworkCore;
+using Volo.Abp.IdentityServer.EntityFrameworkCore;
+using Volo.Abp.PermissionManagement.EntityFrameworkCore;
+using Volo.Abp.SettingManagement.EntityFrameworkCore;
+using Volo.Abp.TenantManagement.EntityFrameworkCore;
+
+namespace LINGYUN.Platform.EntityFrameworkCore
+{
+ public class PlatformHttpApiHostMigrationsDbContext : AbpDbContext
+ {
+ public PlatformHttpApiHostMigrationsDbContext(DbContextOptions options)
+ : base(options)
+ {
+
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ base.OnModelCreating(modelBuilder);
+
+ modelBuilder.ConfigureIdentity();
+ modelBuilder.ConfigureIdentityServer(options =>
+ {
+ options.TablePrefix = "IdentityServer";
+ options.Schema = null;
+ options.DatabaseProvider = EfCoreDatabaseProvider.MySql;
+ });
+ modelBuilder.ConfigureTenantManagement();
+ modelBuilder.ConfigureSettingManagement();
+ modelBuilder.ConfigurePermissionManagement();
+ }
+ }
+}
diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs
new file mode 100644
index 000000000..9dd641cfd
--- /dev/null
+++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs
@@ -0,0 +1,29 @@
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Design;
+using Microsoft.Extensions.Configuration;
+
+namespace LINGYUN.Platform.EntityFrameworkCore
+{
+ public class PlatformHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory
+ {
+ public PlatformHttpApiHostMigrationsDbContext CreateDbContext(string[] args)
+ {
+ var configuration = BuildConfiguration();
+
+ var builder = new DbContextOptionsBuilder()
+ .UseMySql(configuration.GetConnectionString("Default"));
+
+ return new PlatformHttpApiHostMigrationsDbContext(builder.Options);
+ }
+
+ private static IConfigurationRoot BuildConfiguration()
+ {
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(Directory.GetCurrentDirectory())
+ .AddJsonFile("appsettings.Development.json", optional: false);
+
+ return builder.Build();
+ }
+ }
+}
diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantConnectionStringCreateEventHandler.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantConnectionStringCreateEventHandler.cs
new file mode 100644
index 000000000..6b70ba77a
--- /dev/null
+++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantConnectionStringCreateEventHandler.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace LINGYUN.Platform.EventBus.Handlers
+{
+ public class TenantConnectionStringCreateEventHandler
+ {
+ }
+}
diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs
index 52467ef6f..2eb2c586d 100644
--- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs
+++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs
@@ -70,7 +70,7 @@ namespace LINGYUN.Platform.EventBus.Handlers
}
await PermissionGrantRepository.GetDbContext().Database.ExecuteSqlRawAsync(batchInsertPermissionSql);
- await unitOfWork.CompleteAsync();
+ await unitOfWork.SaveChangesAsync();
}
}
}
diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs
index aae3df09a..d642b1eea 100644
--- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs
+++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs
@@ -57,7 +57,7 @@ namespace LINGYUN.Platform.EventBus.Handlers
await PermissionGrantRepository.GetDbContext().Database
.ExecuteSqlRawAsync(batchRmovePermissionSql);
- await unitOfWork.CompleteAsync();
+ await unitOfWork.SaveChangesAsync();
}
}
diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj
index 04e995be5..4bc6d412b 100644
--- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj
+++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj
@@ -32,22 +32,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vueJs/src/api/users.ts b/vueJs/src/api/users.ts
index 70cf9e68f..f7555d49e 100644
--- a/vueJs/src/api/users.ts
+++ b/vueJs/src/api/users.ts
@@ -79,6 +79,16 @@ export default class UserApiService {
})
}
+ public static resetPassword(input: UserResetPasswordData) {
+ const _url = '/api/account/phone/reset-password'
+ return ApiService.HttpRequest({
+ baseURL: IdentityServiceUrl,
+ url: _url,
+ data: input,
+ method: 'PUT'
+ })
+ }
+
public static userRegister(registerData: UserRegisterData) {
const _url = '/api/account/phone/register'
return ApiService.HttpRequest({
@@ -224,8 +234,9 @@ export class UserLoginData {
}
export enum VerifyType {
- register = 0,
- signin = 10
+ Register = 0,
+ Signin = 10,
+ ResetPassword = 20
}
export class PhoneVerify {
@@ -233,6 +244,15 @@ export class PhoneVerify {
verifyType!:VerifyType
}
+export class UserResetPasswordData {
+ /** 手机号码 */
+ phoneNumber!: string
+ /** 手机验证码 */
+ verifyCode!: string
+ /** 新密码 */
+ newPassword!: string
+}
+
/** 用户手机登录对象 */
export class UserLoginPhoneData {
/** 手机号码 */
diff --git a/vueJs/src/components/LangSelect/index.vue b/vueJs/src/components/LangSelect/index.vue
index c96add06d..7ecc4778b 100644
--- a/vueJs/src/components/LangSelect/index.vue
+++ b/vueJs/src/components/LangSelect/index.vue
@@ -30,6 +30,7 @@
+
+