public virtual ReturnInfo <LoginReturnInfo> LoginToToken(LoginInfo loginInfo)
        {
            if (IdentityTokenAuth == null)
            {
                var re = new ReturnInfo <LoginReturnInfo>();
                re.SetFailureMsg("不支持令牌登录");

                return(re);
            }
            return(ExecLogin(loginInfo, (user, pwd, reInfo) =>
            {
                var busRe = IdentityTokenAuth.AccreditToToken(loginInfo.LoginId, loginInfo.Password);
                reInfo.FromBasic(busRe);
                if (reInfo.Success())
                {
                    reInfo.Data.Token = busRe.Data;
                }
            }));
        }
예제 #2
0
        public virtual ReturnInfo <LoginReturnInfo> LoginToToken(LoginInfo loginInfo)
        {
            if (IdentityTokenAuth == null)
            {
                var re = new ReturnInfo <LoginReturnInfo>();
                re.SetFailureMsg("不支持令牌登录");

                return(re);
            }
            var comData = HttpContext.CreateCommonUseData(ComDataFactory, menuCode: "Authorization", functionCodes: "LoginToToken");

            return(ExecLogin(loginInfo, (user, pwd, reInfo) =>
            {
                var busRe = IdentityTokenAuth.AccreditToToken(loginInfo.LoginId, loginInfo.Password, comData);
                reInfo.FromBasic(busRe);
                if (reInfo.Success())
                {
                    reInfo.Data.Token = busRe.Data;
                }
            }));
        }