云库增加 AI识图,缓存,我的云库收藏增加安全标志
调用外部API 扣费
This commit is contained in:
1 parent
7c29e57623
commit
150e8644b7
49 files changed
+1069
-28
No files matched your search
@@ -9,8 +9,7 @@ using Store.Users.Contracts;
|
||||
namespace Store.Api.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[Route("/v{version:apiVersion}/[controller]/[action]")]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AuthController : ControllerBase
|
||||
{
|
||||
private readonly IUserAuthenticationService _users;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
810910819204
|
||||
@@ -1,7 +1,9 @@
|
||||
using Asp.Versioning;
|
||||
using Asp.Versioning.OpenApi;
|
||||
using Hangfire;
|
||||
using MAX.Framework.Conventions;
|
||||
using MAX.Framework.DependencyInjection;
|
||||
using MAX.Framework.Security;
|
||||
using Scalar.AspNetCore;
|
||||
|
||||
public partial class Program
|
||||
@@ -80,6 +82,10 @@ public partial class Program
|
||||
|
||||
app.UseAuthorization();
|
||||
app.UseStoreHangfire();
|
||||
// UTC 19:00 即北京时间次日 03:00;固定任务 ID 避免重启后重复注册。
|
||||
app.Services.GetRequiredService<IRecurringJobManager>().AddOrUpdate<TokenService>(
|
||||
"token-cleanup", service => service.CleanupExpiredTokens(), Cron.Daily(19),
|
||||
new RecurringJobOptions { TimeZone = TimeZoneInfo.Utc });
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
|
||||
@@ -8,15 +8,25 @@
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=192.168.0.200;Port=3306;Database=mysql;Uid=root;Pwd=123456;",
|
||||
},
|
||||
// 登录认证:请求头使用 Authorization: Bearer <accessToken>。
|
||||
"TokenAuth": {
|
||||
// 闲置有效期(天):从签发或最近一次续期起计算。
|
||||
"IdleDays": 7,
|
||||
// 最长有效期(天):从签发起计算,到期必须重新登录。
|
||||
"AbsoluteMaxDays": 30,
|
||||
// 续期间隔(分钟):有效请求间隔达到此值才续期,不能超过最长有效期。
|
||||
"RenewIntervalMinutes": 10,
|
||||
// 本机认证缓存(秒):0 不缓存;跨实例撤销最多延迟此时长生效。
|
||||
"CacheSeconds": 30,
|
||||
// 有效会话上限:0 不限制;超限踢出最早会话,相同 deviceId 替换旧会话。
|
||||
"MaxDevicesPerUser": 0,
|
||||
// 开发固定令牌:仅 Development 环境生效,不受上述限制。
|
||||
"DevelopmentToken": {
|
||||
// 是否启用;appsettings.Development.json 中覆盖为 true。
|
||||
"Enabled": false,
|
||||
// 调试用 Bearer 令牌,不能为空,区分大小写。
|
||||
"Token": "store-local-dev-7f2c9e4a6b814d38a5910e62c4f837bd",
|
||||
// 调试身份的用户名,不能为空,建议填写已有账号。
|
||||
"UserName": "18990991234"
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user