mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:43:26 +08:00
【新增】后端用户登录增加简单单点登录限制功能。
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user