|
|
@ -118,11 +118,14 @@ public class AuthService : IAuthService, IDynamicApiController, ITransient
|
|
|
|
// 设置Swagger自动登录
|
|
|
|
// 设置Swagger自动登录
|
|
|
|
_httpContextAccessor.HttpContext.SigninToSwagger(accessToken);
|
|
|
|
_httpContextAccessor.HttpContext.SigninToSwagger(accessToken);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jwtSettinng = App.GetConfig<JWTSettingsOptions>("JWTSettings");
|
|
|
|
|
|
|
|
|
|
|
|
// 生成刷新Token令牌
|
|
|
|
// 生成刷新Token令牌
|
|
|
|
var refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, 720);
|
|
|
|
var refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, jwtSettinng.RefreshTokenExpired);
|
|
|
|
|
|
|
|
|
|
|
|
// 设置刷新Token令牌
|
|
|
|
// 设置刷新Token令牌
|
|
|
|
_httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;
|
|
|
|
_httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;
|
|
|
|
|
|
|
|
_logger.LogInformation($"{user.Account} 登录颁发刷新token,有效期:{jwtSettinng.RefreshTokenExpired} 分钟");
|
|
|
|
|
|
|
|
|
|
|
|
var httpContext = App.HttpContext;
|
|
|
|
var httpContext = App.HttpContext;
|
|
|
|
await _eventPublisher.PublishAsync(new ChannelEventSource("Update:UserLoginInfo",
|
|
|
|
await _eventPublisher.PublishAsync(new ChannelEventSource("Update:UserLoginInfo",
|
|
|
@ -177,8 +180,10 @@ public class AuthService : IAuthService, IDynamicApiController, ITransient
|
|
|
|
// 设置Swagger自动登录
|
|
|
|
// 设置Swagger自动登录
|
|
|
|
_httpContextAccessor.HttpContext.SigninToSwagger(accessToken);
|
|
|
|
_httpContextAccessor.HttpContext.SigninToSwagger(accessToken);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jwtSettinng = App.GetConfig<JWTSettingsOptions>("JWTSettingsOptions");
|
|
|
|
|
|
|
|
|
|
|
|
// 生成刷新Token令牌
|
|
|
|
// 生成刷新Token令牌
|
|
|
|
var refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, 30);
|
|
|
|
var refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, jwtSettinng.RefreshTokenExpired);
|
|
|
|
|
|
|
|
|
|
|
|
// 设置刷新Token令牌
|
|
|
|
// 设置刷新Token令牌
|
|
|
|
_httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;
|
|
|
|
_httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;
|
|
|
|