コード例 #1
0
 public ActionResult Landing()
 {
     var landingPageViewModel = new LandingPageViewModel {
         SignInUrl = string.Format("https:{0}/{1}/login", _platformSettings.PlatformPagesBaseUrl, _applicationSettings.AppId)
     };
     return View(landingPageViewModel);
 }
コード例 #2
0
        public ActionResult Landing()
        {
            var userState = _platformProxy.Get<UserState>("auth/user-state");

            var viewModel = new LandingPageViewModel();

            if (userState == UserState.Authenticated || userState == UserState.Authorized)
            {
                var currentUser = _platformProxy.Get<User>("/users/current");
                viewModel.UserName = currentUser.Name;
            }

            var wantedTagsIds = new List<long>
                       	{
                       		220057L,
                       		220015L
                       	};

            var tagList = new KeyValuePair<string, object>("ids",wantedTagsIds);
            var followedTags = _platformProxy.Get<List<Tag>>("/tags/get", tagList);

            viewModel.LoginRedirectUrl = _platformRoutes.Login;
            viewModel.Tags = followedTags;
            viewModel.UserState = userState;

            return View(viewModel);
        }