fix:修改文字
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
.NET Core / build (push) Waiting to run

This commit is contained in:
anjoy8 2024-08-25 17:03:25 +08:00
parent c7d89cfdf0
commit d549995e8c
3 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,7 @@ namespace Blog.Core.Controllers
{ {
string jwtStr = string.Empty; string jwtStr = string.Empty;
bool suc = false; bool suc = false;
//这里就是用户登以后,通过数据库去调取数据,分配权限的操作 //这里就是用户登以后,通过数据库去调取数据,分配权限的操作
var user = await _sysUserInfoServices.GetUserRoleNameStr(name, MD5Helper.MD5Encrypt32(pass)); var user = await _sysUserInfoServices.GetUserRoleNameStr(name, MD5Helper.MD5Encrypt32(pass));
if (user != null) if (user != null)
@ -101,7 +101,7 @@ namespace Blog.Core.Controllers
{ {
string jwtStr = string.Empty; string jwtStr = string.Empty;
bool suc = false; bool suc = false;
//这里就是用户登以后,通过数据库去调取数据,分配权限的操作 //这里就是用户登以后,通过数据库去调取数据,分配权限的操作
//这里直接写死了 //这里直接写死了
if (name == "admins" && pass == "admins") if (name == "admins" && pass == "admins")
{ {

View File

@ -13,7 +13,7 @@ namespace Blog.Core.AuthHelper
/// <summary> /// <summary>
/// 获取基于JWT的Token /// 获取基于JWT的Token
/// </summary> /// </summary>
/// <param name="claims">需要在登的时候配置</param> /// <param name="claims">需要在登的时候配置</param>
/// <param name="permissionRequirement">在startup中定义的参数</param> /// <param name="permissionRequirement">在startup中定义的参数</param>
/// <returns></returns> /// <returns></returns>
public static TokenInfoViewModel BuildJwtToken(Claim[] claims, PermissionRequirement permissionRequirement) public static TokenInfoViewModel BuildJwtToken(Claim[] claims, PermissionRequirement permissionRequirement)

View File

@ -149,14 +149,14 @@ namespace Blog.Core.AuthHelper
if (user.IsDeleted) if (user.IsDeleted)
{ {
_user.MessageModel = new ApiResponse(StatusCode.CODE401, "用户已被删除,禁止登!").MessageModel; _user.MessageModel = new ApiResponse(StatusCode.CODE401, "用户已被删除,禁止登!").MessageModel;
context.Fail(new AuthorizationFailureReason(this, _user.MessageModel.msg)); context.Fail(new AuthorizationFailureReason(this, _user.MessageModel.msg));
return; return;
} }
if (!user.Enable) if (!user.Enable)
{ {
_user.MessageModel = new ApiResponse(StatusCode.CODE401, "用户已被禁用!禁止登!").MessageModel; _user.MessageModel = new ApiResponse(StatusCode.CODE401, "用户已被禁用!禁止登!").MessageModel;
context.Fail(new AuthorizationFailureReason(this, _user.MessageModel.msg)); context.Fail(new AuthorizationFailureReason(this, _user.MessageModel.msg));
return; return;
} }