You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
399 B
15 lines
399 B
2 years ago
|
using BuaaLocationServer.Middlewares.Jwts;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
||
|
namespace BuaaLocationServer.Controllers
|
||
|
{
|
||
|
public class BaseController:ControllerBase
|
||
|
{
|
||
|
protected string GetCurrentUserName()
|
||
|
{
|
||
|
var sub = this.HttpContext.User.Claims.First(e => e.Properties.Any(x => x.Value == JwtClaimTypes.Subject));
|
||
|
return sub.Value;
|
||
|
}
|
||
|
}
|
||
|
}
|