22 lines
791 B
Plaintext
22 lines
791 B
Plaintext
|
@inject IOptions<CookieKeyDefine> CKD
|
||
|
|
||
|
<div id="logInForm">
|
||
|
<form fajax-success="loginOnSucc" fajax-failure="loginOnError" method="post" action="/api/User/Login">
|
||
|
<label>用户名:<input type="text" name="userName" /></label>
|
||
|
<label>密码:<input type="password" name="password" /></label>
|
||
|
<input type="submit" value="登录" />
|
||
|
<span id="errormsg"></span>
|
||
|
</form>
|
||
|
</div>
|
||
|
<script type="text/javascript">
|
||
|
function loginOnSucc(d) {
|
||
|
var _userKey = "@CKD.Value.UserKey";
|
||
|
$.cookie(_userKey, d.Ticket);
|
||
|
if (RefreshUserBar) RefreshUserBar();
|
||
|
$("#logInForm").hide();
|
||
|
}
|
||
|
function loginOnError(d) {
|
||
|
var msg = d.responseJSON.Message;
|
||
|
$("#errormsg").text(msg);
|
||
|
}
|
||
|
</script>
|