mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-18 17:48:01 +08:00
check some bugs
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,28 +1,39 @@
|
||||
@{
|
||||
@model OpenAuth.App.SSO.LoginResult
|
||||
|
||||
@{
|
||||
ViewBag.Title = "title";
|
||||
}
|
||||
|
||||
<h2>OpenAuth.net测试站点登陆</h2>
|
||||
<div class="col-lg-12">
|
||||
@if (Model != null && !Model.Success)
|
||||
{
|
||||
<span class="alert alert-danger">@Model.ErrorMsg</span>
|
||||
}
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<form class="form-horizontal" method="POST">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="username">用户名</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="username" name="username" value="admin">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="password">密码</label>
|
||||
<div class="controls">
|
||||
<input type="password" id="password" name="password" value="admin">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox"> Remember me
|
||||
</label>
|
||||
<button type="submit" class="btn btn-primary">登陆</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<form class="form-horizontal" method="POST">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="username">用户名</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="username" name="username" value="admin">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="password">密码</label>
|
||||
<div class="controls">
|
||||
<input type="password" id="password" name="password" value="admin">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox"> Remember me
|
||||
</label>
|
||||
<button type="submit" class="btn btn-primary">登陆</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
Reference in New Issue
Block a user