using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SysCore;
/// <summary>
///LoginState 的摘要说明
/// </summary>
public class LoginState
{
    /// <summary>
    /// 如果登录超时则提示退出系统
    /// </summary>
	public void CheckLogin()
	{
        if (HttpContext.Current.Session["uid"] == null || HttpContext.Current.Session["login_date"] == null)
        {
            if (new LoginInfo().uid == 0)
            {
                HttpContext.Current.Response.Write("<script type='text/javascript'>alert('会话超时,请重新登录系统!');top.location='../../Default.aspx';</script>");
                HttpContext.Current.Response.End();
            }
        }
	}
    /// <summary>
    /// 如果登录超时则提示退出系统(移动端)
    /// </summary>
    public void CheckLoginM()
    {
        if (HttpContext.Current.Session["uid"] == null || HttpContext.Current.Session["login_date"] == null)
        {
            if (new LoginInfo().uid == 0)
            {
                HttpContext.Current.Response.Write("<script type='text/javascript'>alert('会话超时,请重新登录系统!');top.location='../Login.aspx';</script>");
                HttpContext.Current.Response.End();
            }
        }
    }
}