From d7dcb7221f166bf301e939fc311a9c968e0efcf0 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 31 Jul 2025 20:16:13 +0800 Subject: [PATCH] :bug: Fix translate controller shows unexpected unauthorized --- DysonNetwork.Sphere/Chat/ChatRoomController.cs | 2 +- DysonNetwork.Sphere/Translation/TranslationController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DysonNetwork.Sphere/Chat/ChatRoomController.cs b/DysonNetwork.Sphere/Chat/ChatRoomController.cs index 80ea360..490a51a 100644 --- a/DysonNetwork.Sphere/Chat/ChatRoomController.cs +++ b/DysonNetwork.Sphere/Chat/ChatRoomController.cs @@ -74,7 +74,7 @@ public class ChatRoomController( [Authorize] public async Task> CreateDirectMessage([FromBody] DirectMessageRequest request) { - if (HttpContext.Items["CurrentUser"] is not Shared.Proto.Account currentUser) + if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized(); var relatedUser = await accounts.GetAccountAsync( diff --git a/DysonNetwork.Sphere/Translation/TranslationController.cs b/DysonNetwork.Sphere/Translation/TranslationController.cs index 86b511c..b1ca313 100644 --- a/DysonNetwork.Sphere/Translation/TranslationController.cs +++ b/DysonNetwork.Sphere/Translation/TranslationController.cs @@ -1,7 +1,7 @@ -using DysonNetwork.Pass.Account; using System.Security.Cryptography; using System.Text; using DysonNetwork.Shared.Cache; +using DysonNetwork.Shared.Proto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc;