Mini.Crm/Mini.Web/Areas/Admin/Views/Account/LogOn.cshtml

99 lines
3.4 KiB
Plaintext

@model Mini.Web.Areas.Admin.Models.BasInnerUserModel
@{
ViewData["Title"] = "微信CRM--登录";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<style type="text/css">
.login {
margin: 80px auto;
width: 549px;
height: 440px;
}
.login input {
height: 20px;
}
.login_top {
height: 80px;
width: 549px;
background: url("../../../Content/Images/Login_top.jpg") no-repeat;
}
.loginbody {
padding-top: 80px;
width: 547px;
height: 230px;
background: #E4E9ED;
border: 1px solid #CACFD3;
}
.control {
margin-left: 160px;
margin-bottom: 10px;
}
.meg {
font-size: 12px;
color: red;
}
</style>
<div>
<form id="loginForm" method="post" action="@Html.Raw("/Admin/Account/LogOn"+(ViewBag.ReturnUrl!=null?"?returnUrl="+ViewBag.ReturnUrl:""))">
@using (Html.BeginForm())
{
<div class=" login">
<div class="login_top"></div>
<div class="loginbody">
<div class="control">
<span>工号:</span>
@Html.TextBoxFor(m => m.eid, new { style = "width:160px;" })
<span>@Html.ValidationMessageFor(m => m.eid)</span>
</div>
<div class="control">
<span>密码:</span>
@Html.PasswordFor(m => m.passwd, new { style = "width:160px;" })
<span>@Html.ValidationMessageFor(m => m.passwd)</span>
</div>
@if (ViewBag.ShowSnCode != null && ViewBag.ShowSnCode)
{
<div class="control" id="divSnCode">
<span>验证码:</span>
@Html.TextBoxFor(m => m.SnCode, new { style = "width:60px;" })
<img id="valiCode" style="cursor: pointer;vertical-align:text-bottom" onclick="ShowNewCode(this)" alt="验证码" />
<span>@Html.ValidationMessageFor(m => m.SnCode)</span>
</div>
}
<div class="control">
@*<input style="height:10px;line-height:10px;" name="RememberMe" type="checkbox" value="1" checked="checked" /><label>记住密码</label>*@
<input style="width:50px;height:30px; margin-left:70px;cursor:pointer;" type="submit" value="登录" />
</div>
<div style="margin-left: 150px;" class="meg">@this.ViewBag.LogOnError</div>
</div>
</div>
}
</form>
</div>
<script type="text/javascript">
$(function () {
$("html").die().live("keydown", function (event) {
if (event.keyCode == 13) {
//这里添加要处理的逻辑
$("#loginForm").submit();
}
});
$("#valiCode").attr("src", "/Account/GetValidateCode?y=" + GetGuid());
});
function ShowNewCode(img) {
$(img).attr("src", "/Account/GetValidateCode?y=" + GetGuid());
}
function GetGuid() {
var s4 = function () {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
};
return s4() + s4() + s4() + "-" + s4();
}
</script>