:zap:角色管理优化

This commit is contained in:
不做码农
2023-09-27 10:11:48 +08:00
parent 56c4b8897b
commit 31980c80bb
3 changed files with 13 additions and 18 deletions
@@ -82,10 +82,11 @@ namespace ZR.ServiceCore.Middleware
if (!HasPermi && !Permission.Equals("common"))
{
logger.Info($"用户{info.UserName}没有权限访问{url},当前权限[{Permission}]");
JsonResult result = new(new ApiResult((int)ResultCode.FORBIDDEN, $"你当前没有权限[{Permission}]访问,请联系管理员", url))
JsonResult result = new(new ApiResult((int)ResultCode.FORBIDDEN, $"你当前没有权限访问,请联系管理员", url))
{
ContentType = "application/json",
};
context.HttpContext.Response.StatusCode = 403;
context.Result = result;
}
}