mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 16:23:26 +08:00
【优化】后台单点登录有效时间调整为最长24小时,并优化挤退策略。
This commit is contained in:
@@ -124,24 +124,14 @@ namespace CoreCms.Net.Auth
|
||||
if (string.IsNullOrEmpty(mJwt))
|
||||
{
|
||||
context.Response.Headers.Append("Token-Error-Token", "UserLoginStatusError");
|
||||
var jm = new AdminUiCallBack();
|
||||
jm.code = 401;
|
||||
jm.data = 401;
|
||||
jm.msg = "Sorry, your login information could not be found.";
|
||||
context.Response.WriteAsync(JsonConvert.SerializeObject(jm));
|
||||
return Task.CompletedTask;
|
||||
context.Token = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mJwt != token)
|
||||
{
|
||||
context.Response.Headers.Append("Token-Error-Token", "The current user logged in elsewhere");
|
||||
var jm = new AdminUiCallBack();
|
||||
jm.code = 401;
|
||||
jm.data = 401;
|
||||
jm.msg = "Sorry, your account has already been logged in elsewhere.";
|
||||
context.Response.WriteAsync(JsonConvert.SerializeObject(jm));
|
||||
return Task.CompletedTask;
|
||||
context.Token = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user