public virtual ReturnInfo <LoginReturnInfo> Login(LoginInfo loginInfo)
        {
            if (IdentityAuth == null && IdentityBasicAuth == null)
            {
                var re = new ReturnInfo <LoginReturnInfo>();
                re.SetFailureMsg("不支持登录");

                return(re);
            }

            return(ExecLogin(loginInfo, (user, pwd, reInfo) =>
            {
                if (IdentityAuth != null)
                {
                    var busRe = IdentityAuth.Accredit(loginInfo.LoginId, loginInfo.Password);
                    reInfo.FromBasic(busRe);
                }
                else
                {
                    var busRe = IdentityBasicAuth.Accredit(loginInfo.LoginId, loginInfo.Password);
                    reInfo.FromBasic(busRe);
                }

                reInfo.Data = reInfo.Data;
            }));
        }
Exemple #2
0
        public virtual ReturnInfo <LoginReturnInfo> Login(LoginInfo loginInfo)
        {
            if (IdentityAuth == null && IdentityBasicAuth == null)
            {
                var re = new ReturnInfo <LoginReturnInfo>();
                re.SetFailureMsg("不支持登录");

                return(re);
            }


            var comData = HttpContext.CreateCommonUseData(ComDataFactory, menuCode: "Authorization", functionCodes: "Login");

            return(ExecLogin(loginInfo, (user, pwd, reInfo) =>
            {
                if (IdentityAuth != null)
                {
                    var busRe = IdentityAuth.Accredit(loginInfo.LoginId, loginInfo.Password, comData);
                    reInfo.FromBasic(busRe);
                }
                else
                {
                    var busRe = IdentityBasicAuth.Accredit(loginInfo.LoginId, loginInfo.Password, comData);
                    reInfo.FromBasic(busRe);
                }

                reInfo.Data = reInfo.Data;
            }));
        }