WebUI/User/OAuth_Login.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebBase;

namespace WebUI.User
{
    public partial class OAuth_Login : BasePage
    {
        protected void Page_PreInit(object sender, EventArgs e)
        {
            Page.Theme = EkKeys.Skin;
        }

        protected string turl = string.Empty;
        /// <summary>
        /// 重写父类的虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            this.Init += new EventHandler(UserPage_Init);
        }

        /// <summary>
        /// OnInit事件,检查用户是否已经登录
        /// </summary>
        void UserPage_Init(object sender, EventArgs e)
        {
            //turl = Utils.GetCookie(EkKeys.COOKIE_URL_REFERRER);
            //if (string.IsNullOrEmpty(turl) || turl == HttpContext.Current.Request.Url.ToString().ToLower())
            //{
                turl = "/user/UserCenter.aspx" ; //linkurl("usercenter", "index");
           // }
            if (IsUserLogin())
            {
                //自动登录,跳转URL
                HttpContext.Current.Response.Redirect(turl);
                return;
            }
            //检查是否已授权
              if (HttpContext.Current.Session["oauth_name"] == null || HttpContext.Current.Session["oauth_access_token"] == null || HttpContext.Current.Session["oauth_openid"] == null)
              {
                  HttpContext.Current.Response.Redirect("/error.aspx?msg=" + Utils.UrlEncode("登录失败,用户授权已过期,请重新登录!"));
                  return;
              }
            Model.user_oauth oauthModel = new BLL.user_oauth().GetModel(HttpContext.Current.Session["oauth_name"].ToString(),
                HttpContext.Current.Session["oauth_openid"].ToString());
            if (oauthModel != null)
            {
                //检查用户是否存在
              //  Model.users model = new BLL.users().GetModel(oauthModel.user_name);
                HModel.ek_users model = Bll.Bll_ek_users.GetEntityByWhere(HModel.ek_users._.email == oauthModel.user_name);
                if (model == null)
                {
                    HttpContext.Current.Response.Redirect("/error.aspx?msg=" + Utils.UrlEncode("登录失败,授权用户不存在或已被删除!"));
                    return;
后面还有 17 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。