mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
27 lines
651 B
C#
27 lines
651 B
C#
using System.Web;
|
|
|
|
using OpenAuth.App.DTO;
|
|
|
|
namespace OpenAuth.App
|
|
{
|
|
public class LoginCacheApp
|
|
{
|
|
public static LoginResponse GetLogin()
|
|
{
|
|
var session = HttpContext.Current.Session;
|
|
return session["Login"] as LoginResponse;
|
|
}
|
|
|
|
public static void SetLogin(LoginResponse loginresp)
|
|
{
|
|
var session = HttpContext.Current.Session;
|
|
var login = session["Login"] as LoginResponse;
|
|
if (login != null && login.UserId == loginresp.UserId)
|
|
{
|
|
return;
|
|
}
|
|
session["Login"] = loginresp;
|
|
}
|
|
}
|
|
}
|