feat: admin simple 登录支持 账号@手机号

This commit is contained in:
2025-12-12 22:06:37 +08:00
parent 624a7bc04d
commit 8b18d0cb96
5 changed files with 115 additions and 2 deletions

View File

@@ -77,6 +77,18 @@ public sealed class EfTenantRepository(TakeoutAppDbContext context) : ITenantRep
return context.Tenants.AnyAsync(x => x.ContactPhone == normalized, cancellationToken);
}
/// <inheritdoc />
public Task<long?> FindTenantIdByContactPhoneAsync(string phone, CancellationToken cancellationToken = default)
{
// 1. 标准化手机号
var normalized = phone.Trim();
// 2. 查询租户 ID
return context.Tenants.AsNoTracking()
.Where(x => x.ContactPhone == normalized)
.Select(x => (long?)x.Id)
.FirstOrDefaultAsync(cancellationToken);
}
/// <inheritdoc />
public Task<TenantVerificationProfile?> GetVerificationProfileAsync(long tenantId, CancellationToken cancellationToken = default)
{