diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs index 4fda8ac8..f82fc405 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs @@ -23,6 +23,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// 账户管理 /// [ApiController] + [Authorize] [Route("api/[controller]/[action]")] public class AccountController : ControllerBase { @@ -41,6 +42,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// /// [HttpGet] + [AllowAnonymous] public async Task RestCC() { var user= await _iUserService._repository.GetFirstAsync(u => u.UserName == "cc"); @@ -96,6 +98,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// /// [HttpPost] + [AllowAnonymous] public Result Logout() { return Result.Success("安全登出成功!"); diff --git a/Yi.Framework.Net6/Yi.Framework.Common/Enum/DataScopeEnum.cs b/Yi.Framework.Net6/Yi.Framework.Common/Enum/DataScopeEnum.cs new file mode 100644 index 00000000..ce2bcb1d --- /dev/null +++ b/Yi.Framework.Net6/Yi.Framework.Common/Enum/DataScopeEnum.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Common.Enum +{ + public enum DataScopeEnum + { + All = 0, + Custom = 1, + Dept = 2, + DeptAndUnder = 3, + User = 4 + } +} diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend.cs index 7f8a1214..69680d71 100644 --- a/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend.cs +++ b/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend.cs @@ -29,7 +29,8 @@ namespace Yi.Framework.WebCore public static long GetUserIdInfo(this HttpContext httpContext) { - return Convert.ToInt64(httpContext.User.Claims.FirstOrDefault(u => u.Type== JwtRegisteredClaimNames.Sid)); + var p = httpContext; + return Convert.ToInt64(httpContext .User.Claims.FirstOrDefault(u => u.Type== JwtRegisteredClaimNames.Sid).Value); } ///