Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerifyForSys(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误!").DicInfo());
                return;
            }

            //账号(手机号或Iport账号)
            string strAccount = Request.Form["Account"];
            //密码
            string strPassword = Request.Form["Password"];

            ////账号(手机号或Iport账号)
            //string strAccount = Request.Params["Account"];
            ////密码
            //string strPassword = Request.Params["Password"];

            SysLog log = new SysLog(Request);

            log.strAccount     = strAccount;
            log.strBehavior    = "用户登陆";
            log.strBehaviorURL = "/Entrance/Sys/Login.aspx";

            try
            {
                if (strAccount == null || strPassword == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,登陆失败!").DicInfo());
                    return;
                }

                ILogin2 iLogin = new ILogin2(log);

                //手机号登录&&Iport账号登录
                if (TokenTool.VerifyMobile(strAccount) == "ture")
                {
                    Json = iLogin.GetInfoByMobileLogin(strAccount, strPassword);
                }//手机号登陆
                else
                {
                    Json = iLogin.GetInfoByUserNameLogin(strAccount, strPassword);
                }//Iport账号登录
            }
            catch (Exception ex)
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:用户登陆数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
                log.LogCatalogFailure(string.Format("{0}:用户登陆数据发生异常。{1}", ex.Source, ex.Message));
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerifyForSys(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误!").DicInfo());
                return;
            }

            //参数1
            string strParam1 = Request.Params["Param1"];
            //参数2
            string strParam2 = Request.Params["Param2"];

            try
            {
                if (strParam1 == null || strParam2 == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,登陆失败!").DicInfo());
                    return;
                }

                string[] strArray = new string[4];
                strArray[0] = strParam1;
                strArray[1] = strParam2;
                strArray[2] = Request.Params["SysName"];
                strArray[3] = Request.Params["Sign"];

                Json = JsonConvert.SerializeObject(new DicPackage(true, strArray, null).DicInfo());

                //string ms = "尊敬的用户,你注册的【速配货司机】失败原因我们已查明并修改,请您再次注册,如有不便敬请谅解!";
                //MobileSmsSender.Send("18266265676", ms);
            }
            catch (Exception ex)
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:用户登陆数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
        }