예제 #1
0
        public string GetLogOnUrl(string userName, string password, string cityId, string systemId, string serverId)
        {
            string url      = "";
            string logOnKey = "";

            if (string.IsNullOrEmpty(serverId))
            {
                url = GetUrlFromCity(new Guid(cityId), out serverId);
            }

            if (string.IsNullOrEmpty(password))
            {
                IQueryable <THOK.Authority.DbModel.User> queryCity = UserRepository.GetQueryable();
                var user = queryCity.Single(c => c.UserName == userName);
                password = user.Pwd;
            }

            if (!string.IsNullOrEmpty(serverId))
            {
                url = GetUrlFromServer(new Guid(serverId));
            }
            var key = new UserLoginInfo()
            {
                CityID   = cityId,
                SystemID = systemId,
                UserName = userName,
                Password = password,
                ServerID = serverId
            };

            logOnKey = Des.EncryptDES((new JavaScriptSerializer()).Serialize(key), "12345678");
            url     += @"/Account/LogOn/?LogOnKey=" + Uri.EscapeDataString(logOnKey);
            return(url);
        }