feat: 新增SDK模块、OSS相关功能并优化Redis与代码扩展
1. 新增API版本枚举SDK项,创建SDK基础控制器 2. 添加IList、string扩展方法,新增时间戳扩展工具 3. 新增OSS配置、STS凭证服务、文件处理相关代码 4. 重构Redis缓存组件,替换StackExchange.Redis为CSRedisCore 5. 修复原有Redis操作方法调用,新增基础控制器快捷返回方法 6. 新增阿里云OSS、短信、VOD相关SDK依赖 7. 配置阿里云OSS相关参数到appsettings
This commit is contained in:
@ -2,7 +2,6 @@ using BCrypt.Net;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Auth;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Cache;
|
||||
using QYZH.InteractiveMagazine.IService;
|
||||
|
||||
using QYZH.InteractiveMagazine.Models.Common;
|
||||
@ -57,7 +56,7 @@ public class AdminAuthService(BaseRepository<AdminUser> adminUserRepository, ICo
|
||||
|
||||
var token = JwtHelper.GenerateToken((long)adminUser.Id, adminUser.UserName, jwtSettings);
|
||||
|
||||
await RedisHelper.StringSetAsync($"{TokenKeyPrefix}:{adminUser.Id}", token, TimeSpan.FromMinutes(jwtSettings.ExpiryMinutes));
|
||||
await RedisHelper.SetAsync($"{TokenKeyPrefix}:{adminUser.Id}", token, TimeSpan.FromMinutes(jwtSettings.ExpiryMinutes));
|
||||
|
||||
logger.LogInformation("管理员登录成功,用户名: {UserName}, ID: {UserId}", input.UserName, adminUser.Id);
|
||||
|
||||
@ -74,7 +73,7 @@ public class AdminAuthService(BaseRepository<AdminUser> adminUserRepository, ICo
|
||||
{
|
||||
logger.LogInformation("管理员登出,ID: {UserId}", userId);
|
||||
|
||||
await RedisHelper.KeyDeleteAsync($"{TokenKeyPrefix}:{userId}");
|
||||
await RedisHelper.DelAsync($"{TokenKeyPrefix}:{userId}");
|
||||
|
||||
logger.LogInformation("管理员登出成功,ID: {UserId}", userId);
|
||||
}
|
||||
@ -134,7 +133,7 @@ public class AdminAuthService(BaseRepository<AdminUser> adminUserRepository, ICo
|
||||
throw new BusinessException("修改密码失败", 500);
|
||||
}
|
||||
|
||||
await RedisHelper.KeyDeleteAsync($"{TokenKeyPrefix}:{userId}");
|
||||
await RedisHelper.DelAsync($"{TokenKeyPrefix}:{userId}");
|
||||
|
||||
logger.LogInformation("管理员修改密码成功,ID: {UserId}", userId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user