diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/Chat/TokenService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/Chat/TokenService.cs index 2e192c62..204fda55 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/Chat/TokenService.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/Chat/TokenService.cs @@ -26,6 +26,7 @@ public class TokenService : ApplicationService private readonly ISqlSugarRepository _tokenRepository; private readonly ISqlSugarRepository _usageStatisticsRepository; private readonly ModelManager _modelManager; + public TokenService( ISqlSugarRepository tokenRepository, ISqlSugarRepository usageStatisticsRepository, @@ -90,7 +91,7 @@ public class TokenService : ApplicationService } [HttpGet("token/select-list")] - public async Task> GetSelectListAsync() + public async Task> GetSelectListAsync([FromQuery] bool? includeDefault = true) { var userId = CurrentUser.GetId(); var tokens = await _tokenRepository._DbQueryable @@ -103,13 +104,17 @@ public class TokenService : ApplicationService Name = x.Name, IsDisabled = x.IsDisabled }).ToListAsync(); - - tokens.Insert(0,new TokenSelectListOutputDto + + if (includeDefault == true) { - TokenId = Guid.Empty, - Name = "默认", - IsDisabled = false - }); + tokens.Insert(0, new TokenSelectListOutputDto + { + TokenId = Guid.Empty, + Name = "默认", + IsDisabled = false + }); + } + return tokens; }