check some bugs

This commit is contained in:
yubaolee
2016-07-11 18:21:26 +08:00
parent 9a328c9c90
commit 994ab81ebb
10 changed files with 100 additions and 150 deletions

View File

@@ -16,6 +16,9 @@ namespace OpenAuth.WebTest.Controllers
return View();
}
/// <summary>
/// 跳转到后台管理页面
/// </summary>
public ActionResult Admin()
{
return Redirect(ConfigurationManager.AppSettings["OpenAuthURL"] + "?token=" + Request.Cookies["Token"].Value);

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc;
using OpenAuth.App.SSO;
namespace OpenAuth.WebTest.Controllers
@@ -18,12 +14,12 @@ namespace OpenAuth.WebTest.Controllers
[HttpPost]
public ActionResult Index(string username, string password)
{
var token = AuthUtil.Login("670b14728ad9902aecba32e22fa4f6bd", username, password);
if (!string.IsNullOrEmpty(token))
return Redirect("/home/index?Token=" + token);
var result = AuthUtil.Login("670b14728ad9902aecba32e22fa4f6bd", username, password);
if (result.Success)
return Redirect("/home/index?Token=" + result.Token);
else
{
return View();
return View(result);
}
}