Skip to content

Commit

Permalink
fix:修改文字
Browse files Browse the repository at this point in the history
  • Loading branch information
anjoy8 committed Aug 25, 2024
1 parent c7d89cf commit d549995
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Blog.Core.Api/Controllers/LoginController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async Task<MessageModel<string>> GetJwtStr(string name, string pass)
{
string jwtStr = string.Empty;
bool suc = false;
//这里就是用户登陆以后,通过数据库去调取数据,分配权限的操作
//这里就是用户登录以后,通过数据库去调取数据,分配权限的操作

var user = await _sysUserInfoServices.GetUserRoleNameStr(name, MD5Helper.MD5Encrypt32(pass));
if (user != null)
Expand Down Expand Up @@ -101,7 +101,7 @@ public MessageModel<string> GetJwtStrForNuxt(string name, string pass)
{
string jwtStr = string.Empty;
bool suc = false;
//这里就是用户登陆以后,通过数据库去调取数据,分配权限的操作
//这里就是用户登录以后,通过数据库去调取数据,分配权限的操作
//这里直接写死了
if (name == "admins" && pass == "admins")
{
Expand Down
2 changes: 1 addition & 1 deletion Blog.Core.Extensions/Authorizations/Policys/JwtToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class JwtToken
/// <summary>
/// 获取基于JWT的Token
/// </summary>
/// <param name="claims">需要在登陆的时候配置</param>
/// <param name="claims">需要在登录的时候配置</param>
/// <param name="permissionRequirement">在startup中定义的参数</param>
/// <returns></returns>
public static TokenInfoViewModel BuildJwtToken(Claim[] claims, PermissionRequirement permissionRequirement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ orderby item.Id

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));
return;
}

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));
return;
}
Expand Down

0 comments on commit d549995

Please sign in to comment.