暂时提交
This commit is contained in:
1 parent
5d017740c6
commit
b35f816a87
7 files changed
+96
-2
No files matched your search
@@ -7,6 +7,7 @@ using MAX.Framework.Validation;
|
||||
using Store.Shops.Dtos;
|
||||
using Store.Shops.Entities;
|
||||
using Store.Shops.Mappers;
|
||||
using Store.Shops.Repositories;
|
||||
using Store.Users.Contracts;
|
||||
using Store.Users.Contracts.Dtos;
|
||||
using Store.Users.Contracts.Enums;
|
||||
@@ -17,7 +18,8 @@ namespace Store.Shops.Services;
|
||||
|
||||
/// <summary>微信店铺业务;账号身份来自服务端,普通子账号只能访问主账号明确分配的店铺。</summary>
|
||||
public sealed partial class ShopService(IFreeSql db, ICurrentUser currentUser, IUserQueryService users,
|
||||
PddTokenClient tokens, Microsoft.Extensions.Configuration.IConfiguration configuration) : ITransientDependency
|
||||
PddTokenClient tokens, Microsoft.Extensions.Configuration.IConfiguration configuration,
|
||||
IShopRepository shops) : ITransientDependency
|
||||
{
|
||||
/// <summary>读取当前数据库账户,避免相信客户端传来的身份或管理员标志。</summary>
|
||||
private async Task<UserInfo> Actor()
|
||||
@@ -118,7 +120,7 @@ public sealed partial class ShopService(IFreeSql db, ICurrentUser currentUser, I
|
||||
var mapper = new ShopDetailsMapper();
|
||||
var result = rows.Select(mapper.Map).ToList();
|
||||
var ids = rows.Select(s => s.ShopId).Where(s => !string.IsNullOrEmpty(s)).Distinct().ToArray();
|
||||
var expires = await db.Select<ShopExpireEntity>().Where(e => ids.Contains(e.ShopId)).ToListAsync(ct);
|
||||
var expires = await shops.GetExpireTimes(ids, ct);
|
||||
var paid = actor.Authority?.Contains("充值用户") == true;
|
||||
if (!admin && !string.IsNullOrEmpty(actor.ParentUserName))
|
||||
paid |= (await users.GetUser(actor.ParentUserName)).Authority?.Contains("充值用户") == true;
|
||||
|
||||
Reference in new issue
Block a user