【新增】后端用户登录增加简单单点登录限制功能。

This commit is contained in:
jianweie code
2024-07-30 00:50:24 +08:00
parent b0439968a9
commit ac4bcb2b7a
5 changed files with 52 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ using System.Security.Claims;
using System.Threading.Tasks;
using CoreCms.Net.Auth.OverWrite;
using CoreCms.Net.Auth.Policys;
using CoreCms.Net.Caching.Manual;
using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository;
using CoreCms.Net.IServices;
@@ -138,6 +139,10 @@ namespace CoreCms.Net.Web.Admin.Controllers
loginUrl = "Panel.html"
};
//缓存登录数据
var cacheKey = $"LoginUser:{user.id}";
ManualDataCache.Instance.Set(cacheKey, auth.token);
//插入登录日志
var log = new SysLoginRecord();
log.username = model.userName;