hutongqing
2024-10-25 d85a4b97325020b7efe1a6cdbd55025c6408cec9
WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomAuthorizeFilter.cs
@@ -10,11 +10,11 @@
            // 你的自定义授权逻辑
            // 例如,‌检查用户是否已登录,‌或者他们是否有特定的角色或权限
            if (!context.HttpContext.User.Identity.IsAuthenticated)
            {
                // 用户未登录,‌重定向到登录页面或返回401状态码
                context.Result = new ChallengeResult();
            }
            //if (!context.HttpContext.User.Identity.IsAuthenticated)
            //{
            //    // 用户未登录,‌重定向到登录页面或返回401状态码
            //    context.Result = new ChallengeResult();
            //}
        }
    }
}