修改IsAdmin方法
This commit is contained in:
parent
a68788bdba
commit
e7c4efad1d
@ -1,4 +1,5 @@
|
|||||||
using Infrastructure.Extensions;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Extensions;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
@ -95,8 +96,8 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool IsAdmin(this HttpContext context)
|
public static bool IsAdmin(this HttpContext context)
|
||||||
{
|
{
|
||||||
long id = GetUId(context);
|
var userName = GetName(context);
|
||||||
return id == 1;
|
return userName == GlobalConstant.AdminRole;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user