public async Task <LyciumToken> RefreshToken(long uid, string token) { //校验客户端 var host = _host.GetHost(HttpContext); if (_host.CheckHost(HttpContext, host)) { var serverToken = _token.GetToken(uid); if (serverToken != default && _token.CheckToken(token, serverToken)) { //判断是否存活 if (token == serverToken.PreContent && serverToken.IsAlive) { //存活就返回 _notifier.SendToken(host, serverToken); return(serverToken); } else if (serverToken.CanFlush) { //允许刷新,刷新内容 _token.RefreshAndNotifyToken(serverToken); return(serverToken); } else { _token.LogoutBroadcast(serverToken); } } } else { Response.StatusCode = 403; await Response.WriteAsync("检测到非法请求,请联系管理员!"); } return(null); }