feat: 新增VIP过期自动卸载功能
- 新增`AiRechargeManager`类,实现VIP过期用户的自动卸载逻辑。 - 新增`AiHubConst`常量类,统一管理角色名称。 - 在`IRoleService`中添加`RemoveUserRoleByRoleCodeAsync`方法,用于移除指定用户的角色。 - 在`RoleManager`中实现`RemoveUserRoleByRoleCodeAsync`方法。 - 优化`CurrentExtensions`中VIP角色判断逻辑,使用常量替代硬编码。 - 调整`YiAbpWebModule`中部分代码格式,提升可读性。
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Volo.Abp.Users;
|
||||
using Yi.Framework.AiHub.Domain.Shared.Consts;
|
||||
|
||||
namespace Yi.Framework.AiHub.Domain.Extensions;
|
||||
|
||||
@@ -7,6 +8,6 @@ public static class CurrentExtensions
|
||||
{
|
||||
public static bool IsAiVip(this ICurrentUser currentUser)
|
||||
{
|
||||
return currentUser.Roles.Contains("YiXinAi-Vip") || currentUser.UserName == "cc";
|
||||
return currentUser.Roles.Contains(AiHubConst.VipRole) || currentUser.UserName == "cc";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user