fix: 修复权限判断逻辑(应为 &&,避免始终抛出权限异常)
修正 AiAccountService.GetProfitStatisticsAsync 中的条件判断,原先使用 || 导致即使为 Guo 或 cc 仍被拒绝访问。
This commit is contained in:
@@ -85,7 +85,7 @@ public class AiAccountService : ApplicationService
|
|||||||
[HttpGet("account/profit-statistics")]
|
[HttpGet("account/profit-statistics")]
|
||||||
public async Task<string> GetProfitStatisticsAsync([FromQuery] decimal currentCost)
|
public async Task<string> GetProfitStatisticsAsync([FromQuery] decimal currentCost)
|
||||||
{
|
{
|
||||||
if (CurrentUser.UserName != "Guo" || CurrentUser.UserName != "cc")
|
if (CurrentUser.UserName != "Guo" && CurrentUser.UserName != "cc")
|
||||||
{
|
{
|
||||||
throw new UserFriendlyException("您暂无权限访问");
|
throw new UserFriendlyException("您暂无权限访问");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user