mirror of
https://github.com/anjoy8/Blog.Core.git
synced 2024-09-20 23:48:27 +08:00
fix:修改文字
This commit is contained in:
parent
c7d89cfdf0
commit
d549995e8c
|
@ -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")
|
||||||
{
|
{
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user