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.
14 lines
399 B
14 lines
399 B
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; |
|
} |
|
} |
|
}
|
|
|