修改接口
This commit is contained in:
		@@ -8,8 +8,8 @@ namespace FutureMailAPI.Controllers
 | 
			
		||||
{
 | 
			
		||||
    [ApiController]
 | 
			
		||||
    [Route("api/v1/timeline")]
 | 
			
		||||
    [Authorize]
 | 
			
		||||
    public class TimelineController : ControllerBase
 | 
			
		||||
    
 | 
			
		||||
    public class TimelineController : BaseController
 | 
			
		||||
    {
 | 
			
		||||
        private readonly IPersonalSpaceService _personalSpaceService;
 | 
			
		||||
        private readonly ILogger<TimelineController> _logger;
 | 
			
		||||
@@ -63,19 +63,5 @@ namespace FutureMailAPI.Controllers
 | 
			
		||||
                return StatusCode(500, ApiResponse<TimelineResponseDto>.ErrorResult("服务器内部错误"));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 从JWT令牌中获取当前用户ID
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <returns>用户ID</returns>
 | 
			
		||||
        private int GetCurrentUserId()
 | 
			
		||||
        {
 | 
			
		||||
            var userIdClaim = User.FindFirst(ClaimTypes.NameIdentifier);
 | 
			
		||||
            if (userIdClaim != null && int.TryParse(userIdClaim.Value, out int userId))
 | 
			
		||||
            {
 | 
			
		||||
                return userId;
 | 
			
		||||
            }
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user