zhangxiaofeng 12 months ago
commit fa65146118

@ -1861,6 +1861,10 @@ namespace Myshipping.Application
return ordOut;
}
#endregion
#region 批量编辑相关
/// <summary>
/// 批量编辑
/// </summary>
@ -1889,6 +1893,27 @@ namespace Myshipping.Application
await SendBookingOrder(dto.Id.ToArray());
}
/// <summary>
/// 批量修改船代
/// </summary>
/// <returns></returns>
[HttpPost("/BookingOrder/BachUpdateShipagency")]
public async Task BachUpdateShipagency(BatchUpdateShipagency dto)
{
if (dto == null || dto.Id.Count == 0)
{
throw Oops.Bah("未提交数据");
}
await _rep.UpdateAsync(x => dto.Id.Contains(x.Id), x => new BookingOrder
{
SHIPAGENCY = dto.Shipagency,
SHIPAGENCYID = dto.ShipagencyId
});
await SendBookingOrder(dto.Id.ToArray());
}
#endregion
#region 日志、备注、附件、货运动态、服务项目、货物状态 等

@ -63,4 +63,25 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// </summary>
public DateTime? CLOSEDOCDATE { get; set; }
}
/// <summary>
/// 批量编辑船代
/// </summary>
public class BatchUpdateShipagency
{
/// <summary>
/// 主键
/// </summary>
public List<long> Id { get; set; }
/// <summary>
/// 船代
/// </summary>
public string Shipagency { get; set; }
/// <summary>
/// 船代ID
/// </summary>
public string ShipagencyId { get; set; }
}
}

@ -147,6 +147,10 @@ public class JWTSettingsOptions : IConfigurableOptions
/// 过期时间容错值
/// </summary>
public long ClockSkew { get; set; }
/// <summary>
/// 刷新token过期时间分钟
/// </summary>
public int RefreshTokenExpired { get; set; }
}
/// <summary>
/// 数据库参数

@ -437,6 +437,11 @@
过期时间容错值
</summary>
</member>
<member name="P:Myshipping.Core.JWTSettingsOptions.RefreshTokenExpired">
<summary>
刷新token过期时间分钟
</summary>
</member>
<member name="T:Myshipping.Core.DbConfig">
<summary>
数据库参数

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

@ -47,7 +47,8 @@
"ValidAudience": "myshipping", // string
"ValidateLifetime": true, // bool truetrue
"ExpiredTime": 120, // long 20
"ClockSkew": 30 // long 5
"ClockSkew": 30, // long 5
"RefreshTokenExpired": 1
},
"EncryptKey": {
"AES": "072B13C9AD5644C5B914DFE66F4B5D11",

Loading…
Cancel
Save