添加了一些消息分布页和密码修改的界面
This commit is contained in:
@@ -173,5 +173,32 @@ namespace 软件系统浏览器模版.Controllers
|
||||
}
|
||||
|
||||
|
||||
//POST 这是一个Ajax的请求
|
||||
[HttpPost]
|
||||
[AuthorizeUser]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult CheckPassword(string InputPassword)
|
||||
{
|
||||
if (Request.IsAjaxRequest())
|
||||
{
|
||||
UserAccount account = Session[SessionItemsDescription.UserAccount] as UserAccount;
|
||||
if (InputPassword == account.Password)
|
||||
{
|
||||
//允许修改密码
|
||||
return PartialView("SetPasswordPartial");
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewData["alertMessage"] = "密码验证失败!";
|
||||
return PartialView("_MessageDangerPartial");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewData["alertMessage"] = "请求无效!";
|
||||
return PartialView("_MessageDangerPartial");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,16 @@ namespace 软件系统浏览器模版.Models
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 消息框的状态
|
||||
/// </summary>
|
||||
public enum MessageBoxStyle
|
||||
{
|
||||
success,
|
||||
info,
|
||||
warning,
|
||||
danger
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
36
软件系统浏览器模版/Views/Account/ChangePassword.cshtml
Normal file
36
软件系统浏览器模版/Views/Account/ChangePassword.cshtml
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
@{
|
||||
ViewBag.Title = "ChangePassword";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
@section scripts
|
||||
{
|
||||
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
|
||||
}
|
||||
|
||||
<h2>修改密码:</h2>
|
||||
|
||||
|
||||
<div style="font-family:'Microsoft YaHei UI',Arial, Helvetica, sans-serif;font-size:14px">
|
||||
@using (Ajax.BeginForm("CheckPassword", null, new AjaxOptions { HttpMethod = "Post", UpdateTargetId = "content", InsertionMode = InsertionMode.Replace },
|
||||
new { @class = "form-horizontal" }))
|
||||
{
|
||||
<fieldset>
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="password" name="InputPassword" placeholder="请输入密码确认" required style="max-width:300px">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div id="content">
|
||||
|
||||
</div>
|
||||
<br />
|
||||
39
软件系统浏览器模版/Views/Account/SetPasswordPartial.cshtml
Normal file
39
软件系统浏览器模版/Views/Account/SetPasswordPartial.cshtml
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
|
||||
@section scripts
|
||||
{
|
||||
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
|
||||
}
|
||||
|
||||
|
||||
<div>
|
||||
@{ string updateId = Guid.NewGuid().ToString();}
|
||||
@using (Ajax.BeginForm("SetNewPassword", null, new AjaxOptions { HttpMethod = "Post", UpdateTargetId = updateId, InsertionMode = InsertionMode.Replace },
|
||||
new { @class = "form-horizontal" }))
|
||||
{
|
||||
<fieldset>
|
||||
@Html.AntiForgeryToken()
|
||||
<legend style="font-family:'Microsoft YaHei UI',Arial, Helvetica, sans-serif">请输入密码,两次必须一样</legend>
|
||||
<div class="form-group">
|
||||
<label for="inputPassword1" class="col-lg-2 control-label">密码:</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="password" class="form-control" id="inputPassword1" name="inputPassword1" placeholder="密码5-7位" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="inputPassword2" class="col-lg-2 control-label">再次输入密码:</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="password" class="form-control" id="inputPassword2" name="inputPassword2" placeholder="与上面相同" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-10 col-lg-offset-2">
|
||||
<button type="submit" class="btn btn-primary">提交信息</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
</div>
|
||||
<div id="@updateId">
|
||||
|
||||
</div>
|
||||
6
软件系统浏览器模版/Views/Shared/_MessageDangerPartial.cshtml
Normal file
6
软件系统浏览器模版/Views/Shared/_MessageDangerPartial.cshtml
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
<div class="alert alert-dismissible alert-danger" style="margin:15px 15px">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<h4>错误信息</h4>
|
||||
<p>@ViewData["alertMessage"]</p>
|
||||
</div>
|
||||
7
软件系统浏览器模版/Views/Shared/_MessageInfoPartial.cshtml
Normal file
7
软件系统浏览器模版/Views/Shared/_MessageInfoPartial.cshtml
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
<div class="alert alert-dismissible alert-danger" style="margin:15px 15px">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<h4>一般信息</h4>
|
||||
<p>@ViewData["alertMessage"]</p>
|
||||
</div>
|
||||
7
软件系统浏览器模版/Views/Shared/_MessageSuccessPartial.cshtml
Normal file
7
软件系统浏览器模版/Views/Shared/_MessageSuccessPartial.cshtml
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
<div class="alert alert-dismissible alert-danger" style="margin:15px 15px">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<h4>成功信息</h4>
|
||||
<p>@ViewData["alertMessage"]</p>
|
||||
</div>
|
||||
7
软件系统浏览器模版/Views/Shared/_MessageWarningPartial.cshtml
Normal file
7
软件系统浏览器模版/Views/Shared/_MessageWarningPartial.cshtml
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
<div class="alert alert-dismissible alert-danger" style="margin:15px 15px">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<h4>警告信息</h4>
|
||||
<p>@ViewData["alertMessage"]</p>
|
||||
</div>
|
||||
@@ -220,6 +220,12 @@
|
||||
<Content Include="Views\Home\UpdateLog.cshtml" />
|
||||
<Content Include="Views\Home\VersionInformation.cshtml" />
|
||||
<Content Include="Views\Home\AdviceFeedback.cshtml" />
|
||||
<Content Include="Views\Account\ChangePassword.cshtml" />
|
||||
<Content Include="Views\Shared\_MessageDangerPartial.cshtml" />
|
||||
<Content Include="Views\Account\SetPasswordPartial.cshtml" />
|
||||
<Content Include="Views\Shared\_MessageInfoPartial.cshtml" />
|
||||
<Content Include="Views\Shared\_MessageSuccessPartial.cshtml" />
|
||||
<Content Include="Views\Shared\_MessageWarningPartial.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
||||
Reference in New Issue
Block a user