|
|
|
@ -32,9 +32,7 @@ namespace Tiobon.Core.Controllers |
|
|
|
|
/// <param name="requirement"></param> |
|
|
|
|
/// <param name="roleModulePermissionServices"></param> |
|
|
|
|
/// <param name="logger"></param> |
|
|
|
|
public LoginController(ISysUserInfoServices sysUserInfoServices, IUserRoleServices userRoleServices, |
|
|
|
|
IRoleServices roleServices, PermissionRequirement requirement, |
|
|
|
|
IRoleModulePermissionServices roleModulePermissionServices, ILogger<LoginController> logger) |
|
|
|
|
public LoginController(ISysUserInfoServices sysUserInfoServices, IUserRoleServices userRoleServices, IRoleServices roleServices, PermissionRequirement requirement, IRoleModulePermissionServices roleModulePermissionServices, ILogger<LoginController> logger) |
|
|
|
|
{ |
|
|
|
|
this._sysUserInfoServices = sysUserInfoServices; |
|
|
|
|
this._userRoleServices = userRoleServices; |
|
|
|
@ -138,7 +136,6 @@ namespace Tiobon.Core.Controllers |
|
|
|
|
[HttpGet] |
|
|
|
|
[Route("JWTToken3.0")] |
|
|
|
|
public async Task<ServiceResult<TokenInfoViewModel>> GetJwtToken3(string name = "", string pass = "") |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
string jwtStr = string.Empty; |
|
|
|
|
|
|
|
|
@ -218,9 +215,7 @@ namespace Tiobon.Core.Controllers |
|
|
|
|
var user = await _sysUserInfoServices.QueryById(tokenModel.Uid); |
|
|
|
|
var value = User.Claims.SingleOrDefault(s => s.Type == JwtRegisteredClaimNames.Iat)?.Value; |
|
|
|
|
if (value != null && user.CriticalModifyTime > value.ObjToDate()) |
|
|
|
|
{ |
|
|
|
|
return Failed<TokenInfoViewModel>("很抱歉,授权已失效,请重新授权!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (user != null && !(value != null && user.CriticalModifyTime > value.ObjToDate())) |
|
|
|
|
{ |
|
|
|
@ -259,8 +254,7 @@ namespace Tiobon.Core.Controllers |
|
|
|
|
/// <returns></returns> |
|
|
|
|
[HttpGet] |
|
|
|
|
[Route("jsonp")] |
|
|
|
|
public void Getjsonp(string callBack, long id = 1, string sub = "Admin", int expiresSliding = 30, |
|
|
|
|
int expiresAbsoulute = 30) |
|
|
|
|
public void Getjsonp(string callBack, long id = 1, string sub = "Admin", int expiresSliding = 30, int expiresAbsoulute = 30) |
|
|
|
|
{ |
|
|
|
|
TokenModelJwt tokenModel = new TokenModelJwt |
|
|
|
|
{ |
|
|
|
|